CoCalc
Sharedsupport / 2018-03-29-103001-RealNumber.ipynbOpen in CoCalc

Examples for support purposes...

def RealNumber(s):
    if '.' not in s:
        return QQ(s)
    a = s.split('.')
    return ZZ(a[0]) + ZZ(a[1])/10^len(a[1])
3.45
69/20
matrix(2, [1.5,2.5, 7, 8.333])
[ 3/2 5/2] [ 7 8333/1000]
3.5*x^2 - x*1.23445 + 2/3
7/2*x^2 - 24689/20000*x + 2/3