IEEE 754

William Tanksley wtanksle at dolphin.openprojects.net
Mon Jul 24 20:51:50 EDT 2000


On 24 Jul 2000 23:09:30 GMT, Edward Jason Riedy wrote:
>And John W. Baxter writes:

> - You mean I may someday be able to put aside my answers to the "why 
> - doesn't 2/10 print as 0.2 as we all know it should?" sorts of questions?

I'm not sure whether you mean that 2/10.0 isn't exactly 0.2, or whether
2/10 is 0.

>Way off-topic:  Besides, not all numbers are natural for base-10.  
>One example is pi.  It strongly appears that the only natural base 
>for pi is 16 (pi may be base-16 normal and not base-10 normal).  Not 
>proven yet, but looking likely.  See 
>http://www.nersc.gov/~dhbailey/dhbpapers/bcrandom.ps for some neat
>pi results.

Could you clarify that?  pi is not merely a repeating rational, like 1/3
(in decimal) and 1/5 (in binary); it's trancendental.

>Back on topic:  Python's answer is even more painful to explain:
>> bash-2.03$ python -c 'print 2/10'
>> 0

I suspect that's what he was talking about.  I couldn't tell either.

>Jason


-- 
-William "Billy" Tanksley



More information about the Python-list mailing list