[Numpy-discussion] exp behaviour: is it a bug ?

Jon Saenz jsaenz at wm.lc.ehu.es
Fri Jun 2 10:49:52 CDT 2000


No, it works correctly for me (other Python revision, anyway):
Python 1.5.2 (#3, Sep 27 1999, 15:02:20)  [GCC egcs-2.91.66 19990314
(egcs-1.1.2
  on linux2
Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
>>> from math import *
>>> x=-706.
>>> while x>-900:
...     x=x-1
...     print 'x, exp(x) = %g %g' % (x, exp(x))
... 
x, exp(x) = -707 8.99086e-308
x, exp(x) = -708 3.30755e-308
x, exp(x) = -709 1.21678e-308
.....
x, exp(x) = -898 0
x, exp(x) = -899 0
x, exp(x) = -900 0
>>>


Jon Saenz.				| Tfno: +34 946012470
Depto. Fisica Aplicada II               | Fax:  +34 944648500
Facultad de Ciencias.   \\ Universidad del Pais Vasco \\
Apdo. 644   \\ 48080 - Bilbao  \\ SPAIN

On Fri, 2 Jun 2000, Czerminski, Ryszard wrote:

> 
> Is the behaviour illustrated below a bug
> or the Python's feature ?
> 
> Python 1.5.2 (#4, Mar  3 2000, 15:04:36)  [GCC 2.8.1] on irix6
> Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
> >>>
> >>> from math import exp
> >>> x = -706.
> >>> while x > -900:
> ...    x = x - 1
> ...    print 'x, exp(x) = %g %g' % (x, exp(x))
> ... 
> x, exp(x) = -707 8.99086e-308
> x, exp(x) = -708 3.30755e-308
> x, exp(x) = -709 0
> [...]
> x, exp(x) = -745 0
> Traceback (innermost last):
>   File "<stdin>", line 3, in ?
> OverflowError: math range error
> >>>
> 
> Ryszard Czerminski   phone: (781)994-0479
> ArQule, Inc.         email:ryszard at arqule.com
> 19 Presidential Way  http://www.arqule.com
> Woburn, MA 01801     fax: (781)994-0679
> 
> 
> -----Original Message-----
> From: Jean-Bernard Addor [mailto:jbaddor at physics.mcgill.ca]
> Sent: Friday, June 02, 2000 10:19 AM
> To: Numpy-discussion at lists.sourceforge.net
> Subject: [Numpy-discussion] Is it a bug ?
> 
> 
> Hey Numeric people!
> 
> I am just upgrading to a more recent version of Numeric and observe a new
> behaviour:
> 
> Python 1.5.2 (#9, May 30 2000, 15:08:12)  [GCC 2.95.2 19991024 (release)]
> on linux2
> Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
> Hello from .pythonrc.py
> >>> import Numeric
> >>> Numeric.__version__
> '11'
> >>> Numeric.arange(2)*1j
> Segmentation fault
> 
> Python 1.5.1 (#1, Dec 17 1998, 20:58:15)  [GCC 2.7.2.3] on linux2
> Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
> Hello from .pythonrc.py
> >>> import Numeric
> >>> Numeric.__version__ 
> '1.7'
> >>> Numeric.arange(2)*1j
> array([ 0.+0.j,  0.+1.j])
> 
> I also saw:
>               Numerical Python - Bug Tracking
>               Viewing Open Bugs
>                 Bug ID
>                                            Summary
>                102277
>                      CFLOAT/DOUBLE_setitem crashes when accessing imag.
> part 
> 
> Am I hitting that bug?
> 
> CU
> 
> Jean-Bernard
> 
> 
> _______________________________________________
> Numpy-discussion mailing list
> Numpy-discussion at lists.sourceforge.net
> http://lists.sourceforge.net/mailman/listinfo/numpy-discussion
> 
> _______________________________________________
> Numpy-discussion mailing list
> Numpy-discussion at lists.sourceforge.net
> http://lists.sourceforge.net/mailman/listinfo/numpy-discussion
> 





More information about the Numpy-discussion mailing list