Python fails on math
Grant Edwards
invalid at invalid.invalid
Wed Feb 23 10:24:49 EST 2011
On 2011-02-23, Terry Reedy <tjreedy at udel.edu> wrote:
> On 2/22/2011 2:42 PM, Grant Edwards wrote:
>
>> Except that Python (and computer languages in general) don't deal with
>> real numbers. They deal with floating point numbers, which aren't the
>> same thing. [In case anybody is still fuzzy about that.]
>
> In particular, floats are a fixed finite set of rationals with adjusted
> definitions of the arithmetic operators. The adjustment is necessary
> because the 'proper' answer to an operation may not be one of the
> allowed answers. In other words, f1 float-op f2 may not be the same as
> f1 rat-op f2, and hence float-ops do not always obey the rules of
> rational (or real) operations.
On some (increasingly rare) systems they don't always obey the rules
of base-two float-opts either, but that's a whole different can of
worms.
--
Grant Edwards grant.b.edwards Yow! I want a VEGETARIAN
at BURRITO to go ... with
gmail.com EXTRA MSG!!
More information about the Python-list
mailing list