[Numpy-tickets] [NumPy] #959: atanh(+1) gives nan instead of inf on Windows

NumPy numpy-tickets@scipy....
Tue Nov 25 03:28:23 CST 2008


#959: atanh(+1) gives nan instead of inf on Windows
------------------------+---------------------------------------------------
 Reporter:  faltet      |       Owner:  somebody
     Type:  defect      |      Status:  new     
 Priority:  normal      |   Milestone:  1.3.0   
Component:  numpy.core  |     Version:  devel   
 Severity:  normal      |    Keywords:          
------------------------+---------------------------------------------------
 There is an inconsistency in the positive limit value (+1.) of arctanh
 between 1.2.x and 1.3.x in trunk.  When using !NumPy 1.2.1 one has:

 {{{
 Python 2.4.4 (#71, Oct 18 2006, 08:34:43) [MSC v.1310 32 bit (Intel)] on
 win32
 Type "help", "copyright", "credits" or "license" for more information.
 >>> import numpy
 >>> numpy.__version__
 '1.2.1'
 >>> numpy.arctanh(1.)
 1.#INF
 >>> numpy.isinf
 <ufunc 'isinf'>
 >>> numpy.isinf(numpy.arctanh(1.))
 True
 >>> numpy.arctanh(-1.)
 -1.#INF
 >>> numpy.isinf(numpy.arctanh(-1.))
 True
 }}}

 while when using version 1.3.0.dev6085:

 {{{
 Python 2.6 (r26:66721, Oct  2 2008, 11:35:03) [MSC v.1500 32 bit
 (Intel)] on win32
 Type "help", "copyright", "credits" or "license" for more information.
 >>> import numpy
 >>> numpy.__version__
 '1.3.0.dev6085'
 >>> numpy.arctanh(1.)
 nan
 >>> numpy.isinf(numpy.arctanh(1.))
 False
 >>> numpy.arctanh(-1.)
 -inf
 >>> numpy.isinf(numpy.arctanh(-1.))
 True
 }}}

 As you see, the trunk version returns ``nan`` for arctanh(1.), while
 1.2.1 returns ``inf`` (the correct value).  For arctanh(-1.) both
 versions correctly returns ``-inf``.  I used the official binaries for
 1.2.1, while I've used the MSVC 2008 (32-bit) for compiling trunk (the
 resuilting binaries works badly in both Windows XP 32-bit and Windows
 Vista 64-bit).

 My experiments on Linux shows that they both return ``+inf`` and
 ``-inf``, so it seems that this is a Windows specific issue.

-- 
Ticket URL: <http://scipy.org/scipy/numpy/ticket/959>
NumPy <http://projects.scipy.org/scipy/numpy>
The fundamental package needed for scientific computing with Python.


More information about the Numpy-tickets mailing list