[Python-ideas] Python Float Update

Paul Moore p.f.moore at gmail.com
Mon Jun 1 17:19:37 CEST 2015


On 1 June 2015 at 15:58, Steven D'Aprano <steve at pearwood.info> wrote:
> (Decimals *only* win out due to human bias: we don't care too much that
> 1/7 cannot be expressed exactly as a float using *either* binary or
> decimal, but we do care about 1/10. And we conveniently ignore the case
> of 1/3, because familiarity breeds contempt.)

There is one other "advantage" to decimals - they behave like
electronic calculators (which typically used decimal arithmetic). This
is a variation of "human bias" - we (if we're of a certain age, maybe
today's youngsters are less used to the vagaries of electronic
calculators :-)) are used to seeing 1/3 displayed as 0.33333333, and
showing that 1/3*3 = 0.99999999 was a "fun calculator fact" when I was
at school.

Paul


More information about the Python-ideas mailing list