Rick Regan on Fri, 05 Jun 2009 15:15:56 +0200


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: Is There a Way to Rationalize a Decimal in Pari/GP?


Thanks Bill (and John who contacted me off list). -- bestappr() does the trick!

In my case I always want the exact fraction, so I have to make sure I
specify a large enough denominator. I am converting long decimals, and
I don't want to count decimal places. The easy solution seems to be to
pass bestappr() an arbitrarily large power of 10, like
bestappr(0.1000000000000000055511151231257827021181583404541015626,10^100).

Rick

-- 
“There are 10 types of people ... those who understand binary and
those who don't” -- http://www.exploringbinary.com