Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Two comments about this:

1. In Python 3.0, integer division will return a float, e.g., 1/3 will be 0.3333... At Scipy 2006, Guido explicitly stated in his keynote talk that the design choice he made in Python (i.e., that n/m is floor(n/m)) was a mistake.

2. In Sage (http://sagemath.org), which is built on Python, we do some very minimal preparsing of input, so that 1/3 is the exact rational number 1/3 (instead of Python's stupid 1/3 == 0). We also replace, e.g., 2^3 by 23. Sage is does a lot of exact symbolic and high precision arithmetic, so 1/3 staying the rational 1/3 makes sense as the default (though one can easily change this).

Disclaimer: I started the Sage project.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: