3 ms·
On the other hand, 1/3 is still not the (exact) solution to 3*x=1...
by fdej 10y ago
On the other hand, 1/3 is still not the (exact) solution to 3*x=1...
- lrem 10y agoBut it can be done, even in systems implemented in Python 2. Try the following in http://sagecell.sagemath.org/ http://sagecell.sagemath.org/ x = 1/3 3 * x == 1
- williamstein 10y ago1. I introduced the "Sage preparser", which does things like replacing "1/3" by "Integer(1)/Integer(3)" in Sage, before feeding that input to Python to be evaluated; Robert Bradshaw also did a lot of work on the preparer. The preparser uses a hook into the IPython evaluation system. I decided I really needed Sage to use a preparser like this during a talk I gave at Pycon 2005, based on audience feedback, which is why it exists. 2. I would really like somebody to remove the preparse code from Sage and make it a standalone library available on pypi. Here's the code (happy to relicense it under BSD): https://github.com/sagemath/sage/blob/master/src/sage/repl/preparse.py https://github.com/sagemath/sage/blob/master/src/sage/repl/p... 3. Permalink to your example -- http://sagecell.sagemath.org/?q=nwzdzn http://sagecell.sagemath.org/?q=nwzdzn