Python 3000 deat !? Is true division ever coming ?

rainbow.cougar at gmail.com rainbow.cougar at gmail.com
Tue Feb 14 09:44:02 EST 2006


seb.haase at gmail.com wrote:
> Hi,
> Is it true that that "Python 3000" is dead ?
> Honestly I think that e.g. changing 5/2  to be 2.5 (instead of 2) would
> just break to much code :-(
> On the otherhand I'm using Python as "Matlab replacement" and would
> generally like 5/2 ==2.5
>
>...

It's Comp. Sci. 101, based on third grade artithmetic,  not Python.
5/2=2 is integer division, that's the way integer arithmetic works.
5./2.=2.5 is floating point math, with all the round off errors that
incorporates.

If Matlab assumes floating point, then that's what you're paying the
big bucks for.

Curtis




More information about the Python-list mailing list