Perl is worse!

Andrew Kuchling akuchlin at mems-exchange.org
Fri Jul 28 09:04:12 EDT 2000


Moshe Zadka <moshez at math.huji.ac.il> writes:
> Huh? Is "ab" an integer? What happens when I do "ab"+1? 1+"ab"?
> What happens when I do 1+(6.0**100000)-(6.0^100000)?

$v = "abc"; $v++;  produces "abd".  1 + '0xff' produces 2.9921875.

A long time ago in comp.risks, someone reported a bug in a JavaScript
mortgage calculator.  The calculator used eval(), not atoi(), to
convert strings to integers; a side effect of this was that leading
zeros would cause a number to be interpreted as octal, so 01000 was
not the same as 1000.  For a mortgage calculation, where the user may
not have an estimate of what the correct result is, most users would
probably never discover the error.

--amk



More information about the Python-list mailing list