Mar-24-2019, 08:46 AM
Hi DeaD_EyE.
You wrote: Do you know the biggest differences to Decimal which is in the stdlib of Python? What I know, up to now, is shown in next applied example:
Thanks, and cheers
You wrote: Do you know the biggest differences to Decimal which is in the stdlib of Python? What I know, up to now, is shown in next applied example:
# -------- tempo4.py --------------- from astropy.time import Time from decimal import Decimal; # up to 40 significant figures t = Time('2006-01-15 21:24:37.5', format='iso', scale='utc', precision=6) # print (t.ut1.iso, t.ut1.mjd) print(Decimal(t.ut1.mjd)) # print (t.ut1.jd1, t.ut1.jd2) print (t.tt.iso, t.tt.mjd) print (t.tt.jd1, t.tt.jd2) #---------- OUTPUT ---------- # 2006-01-15 21:24:37.834136 53750.89210456175 # 53750.8921045617535128258168697357177734375 # 2453751.0 0.3921045617535457 # 2006-01-15 21:25:42.684000 53750.89285513889 # 2453751.0 0.3928551388888888With reference to your statement I did not know this library, but I never needed this high precision let me say why I'm familiar with the multiprecision subject. Several years ago I uploaded the following Python webpages [written in italian, because I'm italian as well as some followers] http://precismultipla.altervista.org/index.htm One of the most appreciated has been the item: Python: Numeri di Fibonacci.
Thanks, and cheers