[SciPy-user] Python number handling?

Howey, David A d.howey at imperial.ac.uk
Fri Jul 15 05:42:11 CDT 2005


I'm new to python...
Why, why oh why did someone decide to make python do this:

Integer case

In [5]: 107 / 4 
Out[5]: 26

Float case

In [6]: 107.0  / 4
Out[6]: 26.75

I'm a bit worried that when it come to using variables, because you
don't declare them (eg as integer or float) python might mess up
division and give you the first result above rather than the second.

Has anyone had any problems with this?

Dave



More information about the SciPy-user mailing list