[Python-ideas] Settable defaulting to decimal instead of float

Terry Reedy tjreedy at udel.edu
Thu Jan 12 08:50:30 EST 2017


On 1/12/2017 8:09 AM, George Fischhof wrote:

> And if it is mentioned, I would like to ask why binary floating point is
> "better". It is faster, I agree, but why "better"?

Binary numbers are more evenly spread out.  Consider successive two 
diget numbers .99, 1.0, 1.1.  The difference betweem the first two is 
.01 and that between the next pair is .1, 10 times as large.  This 
remains true for .999, 1.00, 1.01 or any other fixed number of digits. 
For binary floats, the gap size only doubles.  When I used slide rules, 
which have about 3 digits of accuracy, some decades ago, this defect of 
decimal numbers was readily apparent.

-- 
Terry Jan Reedy



More information about the Python-ideas mailing list