Post Reply 
Free42 with IEEE 754-2008 decimal floating-point -- interested in a sneak preview?
03-18-2014, 03:23 PM
Post: #92
RE: Free42 with IEEE 754-2008 decimal floating-point - interested in a sneak preview?
(03-18-2014 07:16 AM)Werner Wrote:  On a real 42S, LOG(9.99999999999) = 1, exactly. Meaning it is the closest number to the exact result. The same holds for any precision. On Free42 Decimal-34, LOG(1e34-1) is 34 and LOG(1e33-1) is 33, exactly, and that's what the result should be.

Good point. I don't want to return incorrect results just for the convenience of a flawed algorithm!
OK, I'll fix LOG like this: use the bid128_ilogb and bid128_scalbn functions to pull out the exponent and normalize the mantissa to the range [1, 10), then use bid128_log10 on the normalized mantissa, and finally add the exponent to the result. That will return exact results for powers of ten, without introducing numerical inconsistencies.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Free42 with IEEE 754-2008 decimal floating-point - interested in a sneak preview? - Thomas Okken - 03-18-2014 03:23 PM



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