[Numpy-discussion] Incorrect OverflowError?
Edward C. Jones
edcjones at erols.com
Thu Oct 23 10:47:31 CDT 2003
#! /usr/bin/env python
from numarray.numerictypes import *
# I run Gentoo 1.4 Linux with gcc 3.2.2.
arr = numarray.zeros((1,), Float64)
arr = 4000000000.0
print '%f' % arr
arr = 4000000000
print "Doesn't get here."
except OverflowError, s:
print 'Python OverflowError raised'
# OverflowError: long int too large to convert to int
# The Python long "4000000000" can be represented as a C double.
# If the OverflowError came from numarray, why was an exception raised?
# Are these problems bugs?
More information about the Numpy-discussion