I did the folloing in python shell:
0L
Um... I was under the impresion that long numbers had very very long
precision. But, it seems that in this case it rounded it to zero
"long" numbers are indeed unbounded, but they're only for integers;
fractions get truncated.
0L
5.07e-25 is between 0 and 1, so it gets rounded to zero.
Perhaps you meant 5.07e+25, which doesn't.
50699999999999999203082240L
(The "noise" digits at the end are there because the original float
value is stored with only 53 significant bits.)
Or perhaps you really do want high-precision fractional values. You
*can* use long for this, by scaling your data so it's an integer. For
example, instead of storing an amount as $1.99, store it as 199 cents
(and remember the scaling by 100). For greater fractional precision,
use higher scaling factors.
The "decimal" class in Python 2.4 will take care of this behind the
scenes.