Skip to main content
fix spelling mistake
Source Link
Kai Burghardt
  • 982
  • 1
  • 6
  • 12

HP‑41C series, 18 B

You must place \$n\$ on top of the stack first (a. k. a. the X register). TheThen you can XEQ (execute) the following program:

01♦LBL "Y"         5 Bytes    global label requires 4 + (length of string) Bytes
   NULL            1 Byte     invisible Null byte before numbers
02 31              2 Bytes    X ≔ 31;  Y ≔ 𝘯
03 −               1 Byte     X ≔ 𝘯 − 31
   NULL            1 Byte     invisible Null byte before numbers
04 16              2 Bytes    place the value 16 on top of the stack; X ≔ 16
05 ∕               1 Byte     X ≔ (𝘯 − 31) ∕ 16
06 E↑X             1 Byte     𝘦 raised to the power of X
07 FIX 2           2 Bytes    show (up to) two place after the radix point
08 RND             1 Byte     round the value
09 RTN             1 Byte     `RTN` does not affect local label search

The fixed decimal point display is always rounded. However, the display settings do not affect the internally stored numbers. To ensure all digits after the second decimal place are zero, too, RND (round) is applied.

HP‑41C series, 18 B

You must place \$n\$ on top of the stack first (a. k. a. the X register). The XEQ (execute) the following program:

01♦LBL "Y"         5 Bytes    global label requires 4 + (length of string) Bytes
   NULL            1 Byte     invisible Null byte before numbers
02 31              2 Bytes    X ≔ 31;  Y ≔ 𝘯
03 −               1 Byte     X ≔ 𝘯 − 31
   NULL            1 Byte     invisible Null byte before numbers
04 16              2 Bytes    place the value 16 on top of the stack; X ≔ 16
05 ∕               1 Byte     X ≔ (𝘯 − 31) ∕ 16
06 E↑X             1 Byte     𝘦 raised to the power of X
07 FIX 2           2 Bytes    show (up to) two place after the radix point
08 RND             1 Byte     round the value
09 RTN             1 Byte     `RTN` does not affect local label search

The fixed decimal point display is always rounded. However, the display settings do not affect the internally stored numbers. To ensure all digits after the second decimal place are zero, too, RND (round) is applied.

HP‑41C series, 18 B

You must place \$n\$ on top of the stack first (a. k. a. the X register). Then you can XEQ (execute) the following program:

01♦LBL "Y"         5 Bytes    global label requires 4 + (length of string) Bytes
   NULL            1 Byte     invisible Null byte before numbers
02 31              2 Bytes    X ≔ 31;  Y ≔ 𝘯
03 −               1 Byte     X ≔ 𝘯 − 31
   NULL            1 Byte     invisible Null byte before numbers
04 16              2 Bytes    place the value 16 on top of the stack; X ≔ 16
05 ∕               1 Byte     X ≔ (𝘯 − 31) ∕ 16
06 E↑X             1 Byte     𝘦 raised to the power of X
07 FIX 2           2 Bytes    show (up to) two place after the radix point
08 RND             1 Byte     round the value
09 RTN             1 Byte     `RTN` does not affect local label search

The fixed decimal point display is always rounded. However, the display settings do not affect the internally stored numbers. To ensure all digits after the second decimal place are zero, too, RND (round) is applied.

Post Undeleted by Kai Burghardt
misinterpreted the challenge, now correct answer
Source Link
Kai Burghardt
  • 982
  • 1
  • 6
  • 12

HP‑41C series, 18 B

You must place \$d\$\$n\$ on top of the stack first (a. k. a. the X register). Then you canThe XEQ (execute) the following program:

01♦LBL "Y"         5 Bytes    global label requires 4 + (length of string) Bytes
02 LN  NULL            1 Byte     take the natural logarithm of `X`;invisible Null Xbyte before ln(𝘥)numbers
02 31  NULL            12 ByteBytes    X invisible Null31; byte beforeY numbers≔ 𝘯
03 16              2 Bytes  1 Byte place the value 16 onX top of𝘯 the stack31
04 *   NULL            1 Byte     Xinvisible Null 16byte ×before ln(𝘥)numbers
04 16  NULL            12 ByteBytes    place invisiblethe Nullvalue byte16 beforeon numberstop of the stack; X ≔ 16
05 31              2 Bytes1 Byte     X ≔ 31;(𝘯  Y31)  16 × ln(𝘥)
06 +  E↑X             1 Byte     X𝘦 raised 16to ×the ln(𝘥)power +of 31X
07 FIX 2           2 Bytes    show (up to) two place after the radix point
08 RND             1 Byte     round the value
09 RTN             1 Byte     `RTN` does not affect local label search

The fixed decimal point display is always rounded. However, the display settings do not affect the internally stored numbers. To ensure all digits after the second decimal place are zero, too, RND (round) is applied.

HP‑41C series, 18 B

You must place \$d\$ on top of the stack first (a. k. a. the X register). Then you can XEQ (execute) the following program:

01♦LBL "Y"         5 Bytes    global label requires 4 + (length of string) Bytes
02 LN              1 Byte     take the natural logarithm of `X`;  X  ln(𝘥)
   NULL            1 Byte     invisible Null byte before numbers
03 16              2 Bytes    place the value 16 on top of the stack
04 *               1 Byte     X  16 × ln(𝘥)
   NULL            1 Byte     invisible Null byte before numbers
05 31              2 Bytes    X ≔ 31;  Y  16 × ln(𝘥)
06 +               1 Byte     X  16 × ln(𝘥) + 31
07 FIX 2           2 Bytes    show (up to) two place after the radix point
08 RND             1 Byte     round the value
09 RTN             1 Byte     `RTN` does not affect local label search

The fixed decimal point display is always rounded. However, the display settings do not affect the internally stored numbers. To ensure all digits after the second decimal place are zero, too, RND (round) is applied.

HP‑41C series, 18 B

You must place \$n\$ on top of the stack first (a. k. a. the X register). The XEQ (execute) the following program:

01♦LBL "Y"         5 Bytes    global label requires 4 + (length of string) Bytes
   NULL            1 Byte     invisible Null byte before numbers
02 31              2 Bytes    X  31;  Y ≔ 𝘯
03                1 Byte     X  𝘯  31
   NULL            1 Byte     invisible Null byte before numbers
04 16              2 Bytes    place the value 16 on top of the stack; X ≔ 16
05                1 Byte     X ≔ (𝘯  31)  16
06 E↑X             1 Byte     𝘦 raised to the power of X
07 FIX 2           2 Bytes    show (up to) two place after the radix point
08 RND             1 Byte     round the value
09 RTN             1 Byte     `RTN` does not affect local label search

The fixed decimal point display is always rounded. However, the display settings do not affect the internally stored numbers. To ensure all digits after the second decimal place are zero, too, RND (round) is applied.

Post Deleted by Kai Burghardt
Source Link
Kai Burghardt
  • 982
  • 1
  • 6
  • 12

HP‑41C series, 18 B

You must place \$d\$ on top of the stack first (a. k. a. the X register). Then you can XEQ (execute) the following program:

01♦LBL "Y"         5 Bytes    global label requires 4 + (length of string) Bytes
02 LN              1 Byte     take the natural logarithm of `X`;  X ≔ ln(𝘥)
   NULL            1 Byte     invisible Null byte before numbers
03 16              2 Bytes    place the value 16 on top of the stack
04 *               1 Byte     X ≔ 16 × ln(𝘥)
   NULL            1 Byte     invisible Null byte before numbers
05 31              2 Bytes    X ≔ 31;  Y ≔ 16 × ln(𝘥)
06 +               1 Byte     X ≔ 16 × ln(𝘥) + 31
07 FIX 2           2 Bytes    show (up to) two place after the radix point
08 RND             1 Byte     round the value
09 RTN             1 Byte     `RTN` does not affect local label search

The fixed decimal point display is always rounded. However, the display settings do not affect the internally stored numbers. To ensure all digits after the second decimal place are zero, too, RND (round) is applied.