Sharedsupport / 2018-03-29-103001-RealNumber.ipynbOpen in CoCalc
Author: William A. Stein
License: GNU General Public License v3.0
Description: Examples for support purposes.
In [1]:
def RealNumber(s): if '.' not in s: return QQ(s) a = s.split('.') return ZZ(a[0]) + ZZ(a[1])/10^len(a[1])
In [2]:
3.45
69/20
In [3]:
matrix(2, [1.5,2.5, 7, 8.333])
[ 3/2 5/2] [ 7 8333/1000]
In [4]:
3.5*x^2 - x*1.23445 + 2/3
7/2*x^2 - 24689/20000*x + 2/3
In [ ]: