Post Reply 
I->R and R->I without (rounding) errors
08-04-2021, 03:08 PM
Post: #8
RE: I->R and R->I without (rounding) errors
(08-04-2021 07:42 AM)Joe Horn Wrote:  
(08-04-2021 07:18 AM)BINUBALL Wrote:  Dear cahlucas,
Unfortunately real on 50g has only 12 digit precision. So after you convert integer to real, last digit is lost. There is no way to get digit beyond 12 digits on real.

Binuball is correct. It is not the fault of I->R that you see roundoff errors when converting 2^41 to a real. The roundoff is caused by the limitations of reals themselves in RPL. They cannot have more than 12 mantissa digits, no matter what. No amount of System RPL or anything else can change that fact. If you need more than 12 digits of accuracy, then you MUST use some other object type than reals.

All of the above is correct, except that using a LongFloat library and converting the integer to a long float instead of a standard real would actually do the trick. So let's say a "certain" amount of code + external libraries might be able to do it.
I could also add the fact that newRPL does not have ANY of the limitations mentioned here. As a matter of fact, the I->R and R->I commands don't exist as they are not needed.

I guess the OP choice is to code around the problem using LongFloat, or get rid of the problem in the first place using newRPL.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: I->R and R->I without (rounding) errors - Claudio L. - 08-04-2021 03:08 PM



User(s) browsing this thread: 1 Guest(s)