Post Reply 
HP-16C simulator bug?
11-26-2024, 08:07 PM (This post was last modified: 11-26-2024 08:08 PM by AnnoyedOne.)
Post: #1
HP-16C simulator bug?
Using the HP-16C simulator from

https://www.hpcalc.org/details/6047

I entered the two IEEE conversion programs from the manual (p116-118, PDF p118-120). The second (float to IEEE) returns the same results as the manual.

However the first (IEEE to float) only does so for two of the three examples.

7F800000 returns 1.107296 '00 with C set. The manual says 9.999999 99 with C and G set.

My real HP-16C returns the correct results for both programs.

I verified the program/re-entered the program multiple times with the same result.

Can anyone please confirm or otherwise a bug in this simulator?

A1

HP-15C (2234A02xxx), HP-16C (2403A02xxx), HP-15C CE (9CJ323-03xxx), HP-20S (2844A16xxx), HP-12C+ (9CJ251)

Find all posts by this user
Quote this message in a reply
11-27-2024, 12:15 PM
Post: #2
RE: HP-16C simulator bug?
I figured it out. This simulator allows floating point numbers greater than 9.999999 99. For exponents greater than 99 a small '1' (it looks like a single quote) is shown instead of an overflow (like a real HP-16C). Hence no 'G' (overflow) flag.

Presumably the programmer used a 'double' to allow for the range of HP-16C floating point numbers but there is no "overflow/underflow" check so...

I wish that a decent HP-16C (NUT code) emulator was available but this simulator will have to do for now.

A1

HP-15C (2234A02xxx), HP-16C (2403A02xxx), HP-15C CE (9CJ323-03xxx), HP-20S (2844A16xxx), HP-12C+ (9CJ251)

Find all posts by this user
Quote this message in a reply
11-27-2024, 12:30 PM
Post: #3
RE: HP-16C simulator bug?
(11-27-2024 12:15 PM)AnnoyedOne Wrote:  I wish that a decent HP-16C (NUT code) emulator was available but this simulator will have to do for now.

A1

The DM16L is a 16C emulator, running the original ROM, albeit not a free one. Today, it behaves exactly the same as a 16C, but it wouldn't be surprising if it behaved a little... well, better in the not too distant future...

--Bob Prosperi
Find all posts by this user
Quote this message in a reply
11-27-2024, 12:35 PM
Post: #4
RE: HP-16C simulator bug?
(11-27-2024 12:30 PM)rprosperi Wrote:  The DM16L is a 16C emulator...

Thanks, but I have a HP-15C CE that has 16C mode. I was using it yesterday with VoyagerSave.

A PC emulator would be nice.

A1

HP-15C (2234A02xxx), HP-16C (2403A02xxx), HP-15C CE (9CJ323-03xxx), HP-20S (2844A16xxx), HP-12C+ (9CJ251)

Find all posts by this user
Quote this message in a reply
11-27-2024, 06:38 PM
Post: #5
RE: HP-16C simulator bug?
FYI I've changed simulators again.

From http://www.hp16c.org (no https)

v2.1.0.036

A1

HP-15C (2234A02xxx), HP-16C (2403A02xxx), HP-15C CE (9CJ323-03xxx), HP-20S (2844A16xxx), HP-12C+ (9CJ251)

Find all posts by this user
Quote this message in a reply
11-27-2024, 07:55 PM
Post: #6
RE: HP-16C simulator bug?
(11-27-2024 12:15 PM)AnnoyedOne Wrote:  I wish that a decent HP-16C (NUT code) emulator was available but this simulator will have to do for now.

The Classic Nonpareil ?

J-F
Visit this user's website Find all posts by this user
Quote this message in a reply
11-28-2024, 03:31 AM (This post was last modified: 11-28-2024 12:10 PM by Thomas Klemm.)
Post: #7
RE: HP-16C simulator bug?
The following programs can be copied and pasted into the JRPN 16C simulator.

Program B
Code:
   001 { 43 22  B } g LBL B
   002 {       23 } HEX
   003 {    42  2 } f 2's
   004 {        2 } 2
   005 {        0 } 0
   006 {    42 44 } f WSIZE
   007 {    42  A } f SL
   008 {       36 } ENTER
   009 {       36 } ENTER
   010 {    43 40 } g x==0
   011 {    22  2 } GTO 2
   012 {        1 } 1
   013 {        8 } 8
   014 {    42  8 } f MASKR
   015 {    42 20 } f AND
   016 {    42 10 } f XOR
   017 {    43 36 } g LSTx
   018 {       34 } X<=>Y
   019 {        8 } 8
   020 {    42  7 } f MASKL
   021 {    43 49 } g x==y
   022 {    22  4 } GTO 4
   023 {       33 } Rv
   024 {    43 40 } g x==0
   025 {    22  3 } GTO 3
   026 {       34 } X<=>Y
   027 {        1 } 1
   028 {        8 } 8
   029 {    42  4 } f SB
   030 { 43 22  1 } g LBL 1
   031 { 43  6  4 } g F? 4
   032 {       49 } CHS
   033 {       34 } X<=>Y
   034 {        8 } 8
   035 {    42  E } f RLn
   036 {        9 } 9
   037 {        7 } 7
   038 {       30 } -
   039 { 43  5  4 } g CF 4
   040 { 43 22  2 } g LBL 2
   041 { 42 45 48 } f FLOAT .
   042 {    43 21 } g RTN
   043 { 43 22  3 } g LBL 3
   044 {        1 } 1
   045 {        8 } 8
   046 {    42  4 } f SB
   047 {       34 } X<=>Y
   048 {    22  1 } GTO 1
   049 { 43 22  4 } g LBL 4
   050 {       33 } Rv
   051 {    43 35 } g CLx
   052 {    43  0 } g x!=y
   053 {    22  5 } GTO 5
   054 {        1 } 1
   055 {        4 } 4
   056 {        5 } 5
   057 {       36 } ENTER
   058 { 43 22  5 } g LBL 5
   059 {       34 } X<=>Y
   060 { 43  6  4 } g F? 4
   061 {       49 } CHS
   062 {    43  B } g ASR
   063 {       34 } X<=>Y
   064 { 43  4  4 } g SF 4
   065 {    22  2 } GTO 2

Examples

HEX 80000000     -0.
GSB B

0.000000 00      C set.


HEX 7F800000     \(+\infty\).
GSB B

9.999999 99      C and G set.


HEX 00800000     \(2^{-126} \times (1.00\cdots00)\).

1.175494-38


HEX 3F800001     \(2^{0} \times (1.00\cdots01)=1+2^{-23}\).
GSB B

1.000000 00

f CLEAR PREFIX

1000000119



Program A
Code:
   066 { 43 22  A } g LBL A
   067 {    42  2 } f 2's
   068 {       23 } HEX
   069 { 43  5  4 } g CF 4
   070 { 43  5  5 } g CF 5
   071 {    43 49 } g x==y
   072 {    43 21 } g RTN
   073 {        9 } 9
   074 {        D } D
   075 {       40 } +
   076 {       34 } X<=>Y
   077 { 43  5  0 } g CF 0
   078 {    43  2 } g x<0
   079 { 43  4  0 } g SF 0
   080 {    43  8 } g ABS
   081 {       34 } X<=>Y
   082 {    43  2 } g x<0
   083 {    22  9 } GTO 9
   084 {        1 } 1
   085 {       40 } +
   086 { 43 22  6 } g LBL 6
   087 {    44 32 } STO I
   088 {       33 } Rv
   089 {        2 } 2
   090 {        0 } 0
   091 {    42 44 } f WSIZE
   092 {        8 } 8
   093 {        0 } 0
   094 {       40 } +
   095 {        1 } 1
   096 {        8 } 8
   097 {    42  7 } f MASKL
   098 {    42 20 } f AND
   099 { 43  6  4 } g F? 4
   100 {    43 24 } g ISZ
   101 {    42  A } f SL
   102 {    45 32 } RCL I
   103 {        F } F
   104 {        F } F
   105 {    43  3 } g x>y
   106 {    22  7 } GTO 7
   107 {       34 } X<=>Y
   108 {       33 } Rv
   109 {       33 } Rv
   110 {    43 35 } g CLx
   111 {    43 33 } g R^
   112 {    43 33 } g R^
   113 { 43  4  5 } g SF 5
   114 { 43 22  7 } g LBL 7
   115 {       33 } Rv
   116 {    42 40 } f OR
   117 { 43  6  0 } g F? 0
   118 {    21  8 } GSB 8
   119 {        9 } 9
   120 {    42  F } f RRn
   121 { 43  5  4 } g CF 4
   122 {    43 21 } g RTN
   123 { 43 22  8 } g LBL 8
   124 {        8 } 8
   125 {    42  4 } f SB
   126 {    43 21 } g RTN
   127 { 43 22  9 } g LBL 9
   128 {    43  8 } g ABS
   129 {        3 } 3
   130 {        0 } 0
   131 {    43  1 } g x<=y
   132 {       34 } X<=>Y
   133 {       33 } Rv
   134 {        0 } 0
   135 {       34 } X<=>Y
   136 {    42  4 } f SB
   137 {       10 } /
   138 {        0 } 0
   139 {    22  6 } GTO 6

Examples

f FLOAT .
8 f EEX 72
GSB A

7F800000 h      G set. Overflows to \(+\infty\).


f FLOAT .
1.404 f EEX 45 CHS
GSB A

1 h


f FLOAT .
3.141592654     \(\pi\).
GSB A

40490Fdb h

Find all posts by this user
Quote this message in a reply
Post Reply 




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