Post Reply 
RPN-PRGM: New Windows console application emulating HP calculators
02-22-2021, 02:10 PM
Post: #22
RE: RPN-PRGM: New Windows console application emulating HP calculators
(02-22-2021 04:40 AM)Aacini Wrote:  Another example:

Code:
RPN: FPUPC:3 1e16 sci:16 out out:" = " eng:17 out out:" = " hex:3 out
1.0000000000000000E+016 = 10.0000000000000000E+0015 = 4034_8E1B_C9BF_03FF_FFF9

RPN: FPUPC:2 1e16 sci:16 out out:" = " eng:17 out out:" = " hex:3 out
1.0000000000000000E+016 = 99.9999999999999744E+0015 = 4034_8E1B_C9BF_03FF_FFF9

RPN: FPUPC:0 1e16 sci:16 out out:" = " eng:17 out out:" = " hex:3 out
9.9999999999999820E+015 = 9.22337203685477580E+0015 = 4034_8E1B_C9BF_03FF_B800

RPN: FPUPC:3 1e16 sci:16 out out:" = " eng:17 out out:" = " hex:3 out
9.9999916826296320E+015 = 9.22337203685477580E+0015 = 4034_8E1B_C200_0000_0000

We should expect 1e16 = 10.000e15, not 100.00e15 or 9.2234e15
Something is wrong with eng:# conversion.

It seems FPUPC:# does not take effect right the way.
(If it does, first line and last line should produce the same result)

---

I had noticed RPN.exe version 1.0 reduced eng:# to 18 significant digits.
Perhaps we can shift eng conversion code to sprintf ?

Just break up the number into parts, then join them together.
Note: we need to confirm 1 ≤ IP(|mantissa|) < 1000

Example: 1.23e1000 = (12 + .3) * 1e999 → "12.3e999"
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: RPN-PRGM: New Windows console application emulating HP calculators - Albert Chan - 02-22-2021 02:10 PM



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