| 1 | initial version |
If you choose to use exec, you can get the desired behavior by adding this line before it:
from __future__ import division
That uses Python 3 to treat the ratio of two integers as true division. More information:
http://stackoverflow.com/questions/575925/how-to-convert-rational-and-decimal-number-strings-to-floats-in-python https://www.python.org/dev/peps/pep-0238/
| 2 | No.2 Revision |
If you choose to use exec, you can get the desired behavior by adding this line before it:
from __future__ import division
That uses Python 3 to treat the ratio of two integers as true division. More information:
http://stackoverflow.com/questions/575925/how-to-convert-rational-and-decimal-number-strings-to-floats-in-python
http://stackoverflow.com/questions/575925/how-to-convert-rational-and-decimal-number-strings-to-floats-in-python
https://www.python.org/dev/peps/pep-0238/
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.