This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: unexpected floating point exponent behaviour
Type: Stage:
Components: Interpreter Core Versions:
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: palana, tim.peters
Priority: normal Keywords:

Created on 2004-10-17 21:39 by palana, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
num.py palana, 2004-10-17 21:39 python exponent errors
Messages (2)
msg22733 - (view) Author: Ruwen Hahn (palana) Date: 2004-10-17 21:39
There's a problem with exponents and numeric literals:

017e4 should be about 150k, but python gives 170k.

Same with hexints, 0x12e4 should be 180k, but python
gives 4836.

I think that python should either throw an error or do
it right.
msg22734 - (view) Author: Tim Peters (tim.peters) * (Python committer) Date: 2004-10-17 21:48
Logged In: YES 
user_id=31435

Closing as invalid.  Octal and hex notations apply only to 
integer literals (see the reference manual).  0x12e4 is an 
integer hex literal ('e' is a hex digit!  so are a, b, c, d, and f), 
and 4836 is its correct decimal equivalent.  017e4 is a 
decimal float literal, denoting the same value as 17e4 (i.e., 
the presence or absence of leading zeroes has no effect on 
the meaning of decimal float literals -- and all float literals in 
Python are decimal float literals).
History
Date User Action Args
2022-04-11 14:56:07adminsetgithub: 41037
2004-10-17 21:39:01palanacreate