Post Reply 
Free42 with IEEE 754-2008 decimal floating-point -- interested in a sneak preview?
03-18-2014, 07:16 AM
Post: #86
RE:Free42 with IEEE 754-2008 decimal floating-point -- interested in a sneak preview?
(03-17-2014 01:29 PM)Thomas Okken Wrote:  In order to make sure LOG doesn't just return exact results for exact powers of 10, but also satisfies

  10n ≤ x < 10n+1 → n ≤ LOG(x) < n+1

This is not possible.
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.
Extracting the exponent should rather be done dividing by the mantissa, that can be determined as follows (thanks to Dieter):
Code:

00 { 25-Byte Prgm }
01*LBL "MANT"
02 ABS
03 1        avoid upper exponent limit. ONLY needed for 9.99999999999e499
04 X<Y?
05 10^X
06 /
07 ENTER
08 X#0?
09 LOG
10 INT
11 10^X
12 /
13 1        multiply by 10 if needed
14 X>Y?
15 10^X
16 *
17 END

Werner

41CV†,42S,48GX,49G,DM42,DM41X,17BII,15CE,DM15L,12C,16CE
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? - Werner - 03-18-2014 07:16 AM



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