?Why is 0e-6 invalid?

Norman Shelley Norman_Shelley-RRDN60 at email.sps.mot.com
Thu Dec 21 18:04:28 EST 2000


Why is 0e-6 invalid and 0*.000001 is valid?

They are equivalent and a "normal" mathematically trained individual
sees them for what they are immediately.

(I have a trivial engineering notation to number convertor that takes
"0u" or "5u" and converts them to "0e-6" and "5e-6" and then evaluates
them. The later works fine, the former fails. Granted I could check for
this condition, but it seems that the Python evaluator should be able to
work on this boundary case as it still consistent.)


>>> 0*.000001
0.0
>>> 1e-6
1e-06
>>> 0e-6
  File "<stdin>", line 1
    0e-6
     ^
SyntaxError: invalid syntax





More information about the Python-list mailing list