A use for integer quotients
Tim Daneliuk
tundra at tundraware.com
Mon Jul 23 15:10:01 EDT 2001
Marcin 'Qrczak' Kowalczyk wrote:
>
> 23 Jul 2001 17:00:01 GMT, Tim Daneliuk <tundra at tundraware.com> pisze:
>
> > - This is not "incorrect" arithmetic. *It is 3/4 == .75 that is incorrect*
> > because the precision of the result exceeds the precision of the operands.
>
> It doesn't exceed if the result is a rational. Operands and the result
> are all exact here.
>
> --
> __("< Marcin Kowalczyk * qrczak at knm.org.pl http://qrczak.ids.net.pl/
> \__/
> ^^ SYGNATURA ZASTÊPCZA
> QRCZAK
Not formally, AFAIK. For example, 3 with no decimal point following
could be anything from 2.5 to 3.4. If I remember correctly, to be
fussy about it, you would need to specify 3.00/4.00 to get 0.75 or am
I missing something or misremembering my ancient maths courses ;) ?
More importantly, the thing everyone is talking about here is an
integer operation yielding a real (float) result. Isn't this kind of
a "no-no" amongst mathematicians?
Maybe I'm wrong here...
--
------------------------------------------------------------------------------
Tim Daneliuk
tundra at tundraware.com
More information about the Python-list
mailing list