On my C43, I have a large integer with ca 288 digits and I would like to see all digits.
However, when executing the command SHIFT SHOW, "only" 270 digits are shown, the groups of three digits ends with a 0...
Is it possible to see all in another way? Or does it mean that all the remaining digits are 0?
Show all digits of a huge integer
Show all digits of a huge integer
/Rudi
DM42 as C43 (s/n 06999), HP42S, HP35s, HP11c, HP32SII (ex HP41CV, ex HP75C, ex HP48G + a lot, really lot of a accessories)
DM42 as C43 (s/n 06999), HP42S, HP35s, HP11c, HP32SII (ex HP41CV, ex HP75C, ex HP48G + a lot, really lot of a accessories)
Re: Show all digits of a huge integer
The logic tells it to stop listing digits because it is almost full. The ellipsis indicates there are more digits which will not be displayed. It does not mean it is zeroes and can be any number of any digits.rudi wrote: ↑Tue Jan 24, 2023 11:53 amOn my C43, I have a large integer with ca 288 digits and I would like to see all digits.
However, when executing the command SHIFT SHOW, "only" 270 digits are shown, the groups of three digits ends with a 0...
Is it possible to see all in another way? Or does it mean that all the remaining digits are 0?
It actually supports 294 digits in SHOW before the ellipsis is shown. We could clear the softmenu to display more digits. That would not be hard, but it does not solve the problem because there could be around 1000 digits, so the work needed to display 3 more lines does not really help.
Print to file using g[EXIT] to get the full number on file.
Jaco Mostert
Elec Eng, South Africa
C43 on DM42 03818, 06199, WP43 pilot 0015. In box: HP42S, HP32Sii, WP34S&C, HP28C, HP35s, EL506P, ELW506, PB700; previous FX702P, 11C, HP67 & HP85; iOS: 42s Byron, Free42, WP31S/34S, HCalc.
Elec Eng, South Africa
C43 on DM42 03818, 06199, WP43 pilot 0015. In box: HP42S, HP32Sii, WP34S&C, HP28C, HP35s, EL506P, ELW506, PB700; previous FX702P, 11C, HP67 & HP85; iOS: 42s Byron, Free42, WP31S/34S, HCalc.
Re: Show all digits of a huge integer
Thanks Jaymos  didn't think of printing and then getting out the file.
Would love to be able to browse all digits though
Guess that I could write a small program for that  I'll try having a look at that.
Would love to be able to browse all digits though
Guess that I could write a small program for that  I'll try having a look at that.
/Rudi
DM42 as C43 (s/n 06999), HP42S, HP35s, HP11c, HP32SII (ex HP41CV, ex HP75C, ex HP48G + a lot, really lot of a accessories)
DM42 as C43 (s/n 06999), HP42S, HP35s, HP11c, HP32SII (ex HP41CV, ex HP75C, ex HP48G + a lot, really lot of a accessories)
Re: Show all digits of a huge integer
Sounds like a job for a short keystroke program. Break the number up in, say, twenty digit lumps and display or store in registers.
Re: Show all digits of a huge integer
Why don't we have a challenge?
Let's see who comes up with the shortest program to be able to view all digits of 2^2234.
Post the programs here. Multiple solutions from people are allowed, i.e. you may try again if someone beat you!
2^2234 must be in X before the program is started. 0 in all other stack registers. Default C43 flag and settings status assumed.
J
Jaco Mostert
Elec Eng, South Africa
C43 on DM42 03818, 06199, WP43 pilot 0015. In box: HP42S, HP32Sii, WP34S&C, HP28C, HP35s, EL506P, ELW506, PB700; previous FX702P, 11C, HP67 & HP85; iOS: 42s Byron, Free42, WP31S/34S, HCalc.
Elec Eng, South Africa
C43 on DM42 03818, 06199, WP43 pilot 0015. In box: HP42S, HP32Sii, WP34S&C, HP28C, HP35s, EL506P, ELW506, PB700; previous FX702P, 11C, HP67 & HP85; iOS: 42s Byron, Free42, WP31S/34S, HCalc.
Re: Show all digits of a huge integer
What a great challenge, I'm in....
Why settle with \(2^{2234}\), why not push it to \(2^{3326}\)  well, any large number in the x register
Why settle with \(2^{2234}\), why not push it to \(2^{3326}\)  well, any large number in the x register
/Rudi
DM42 as C43 (s/n 06999), HP42S, HP35s, HP11c, HP32SII (ex HP41CV, ex HP75C, ex HP48G + a lot, really lot of a accessories)
DM42 as C43 (s/n 06999), HP42S, HP35s, HP11c, HP32SII (ex HP41CV, ex HP75C, ex HP48G + a lot, really lot of a accessories)
Re: Show all digits of a huge integer
Any large number must work, but the contest benchmark is for the largest one that produces 1000 digits, and I copied incorrectly from my screen!
2 ^ 3321 is the one which produces 5.2555 x 10^999. I don't know where I got 2 ^ 2234. Haha  yes I seemed to remember a pattern and did that wrong!
So 2^3321 it is.
Jaco Mostert
Elec Eng, South Africa
C43 on DM42 03818, 06199, WP43 pilot 0015. In box: HP42S, HP32Sii, WP34S&C, HP28C, HP35s, EL506P, ELW506, PB700; previous FX702P, 11C, HP67 & HP85; iOS: 42s Byron, Free42, WP31S/34S, HCalc.
Elec Eng, South Africa
C43 on DM42 03818, 06199, WP43 pilot 0015. In box: HP42S, HP32Sii, WP34S&C, HP28C, HP35s, EL506P, ELW506, PB700; previous FX702P, 11C, HP67 & HP85; iOS: 42s Byron, Free42, WP31S/34S, HCalc.
Re: Show all digits of a huge integer
A straightforward solution. Dirty program... but eventually it works!
82 bytes / 35 steps
It breaks down integer into 18 digits lumps and store it from R01.
2 3321 ^ R/S
=====>
5 255 518 873 in R01
824 416 903 687 982 113 in R02
...
23 697 137 731 633 152 in R56 (notice 0 is omitted)
EDIT) Found one problem with this: like large factorial, if you have many, many 0s at the end, we cannot distinguish where the integer finishes.
82 bytes / 35 steps
Code: Select all
LBL 'BREAK'
STO 00
LOG
IP
1
+
STO I
18
/
ceil
1000
/
1
+
STO J
LBL 00
RCL 00
RCL I
18
/
ceil
RCL J
IP

18
*
10^x
IDIV
18
10^x
MOD
STO→J
ISG J
GTO 00
END
2 3321 ^ R/S
=====>
5 255 518 873 in R01
824 416 903 687 982 113 in R02
...
23 697 137 731 633 152 in R56 (notice 0 is omitted)
EDIT) Found one problem with this: like large factorial, if you have many, many 0s at the end, we cannot distinguish where the integer finishes.
S.Korean / HP50G  fx570EX  fx570CW  HP200LX
Re: Show all digits of a huge integer
My second try after independently seeing the zeroes issue: 105 bytes, 38 steps.
See register 23  the problem of the leading zeroes would have been there.
To view it, you have to press g[REGS] 02, to make the register browser start at 2. The register after the last one will contain the end pointer and the X register ends with the same end pointer. I actually think there is no reason that we should not have REGS programmable. I think we should change that.
See register 23  the problem of the leading zeroes would have been there.
Code: Select all
01 LBL ‘SPLIT’
02 34
03 10^X
04 STO 00
05 DROP
06 2
07 STO 01
08 DROP
09 LBL ‘LL’
10 ENTER
11 RCL 00
12 MOD
13 XEQ ‘>SS’
14 INC 01
15 
16 RCL 00
17 IDIV
18 X ≠ ? 0.
19 GTO ‘LL’
20 𝑎 ‘END REG ‘
21 RCL 01
22 +
23 STO >01
24 RTN
25 LBL ‘>SS’
26 ENTER
27 RCL 00
28 + //Add 10^34 to preserve the zeroes
29 𝑎 ‘ ‘
30 + //Add a space to convert to string
31 1
32 𝑎SL Y
33 𝑎SR Y
34 DROP
35 STO >01
36 DROP
37 RTN
38.END.
To view it, you have to press g[REGS] 02, to make the register browser start at 2. The register after the last one will contain the end pointer and the X register ends with the same end pointer. I actually think there is no reason that we should not have REGS programmable. I think we should change that.
Last edited by Jaymos on Thu Jan 26, 2023 7:35 pm, edited 1 time in total.
Jaco Mostert
Elec Eng, South Africa
C43 on DM42 03818, 06199, WP43 pilot 0015. In box: HP42S, HP32Sii, WP34S&C, HP28C, HP35s, EL506P, ELW506, PB700; previous FX702P, 11C, HP67 & HP85; iOS: 42s Byron, Free42, WP31S/34S, HCalc.
Elec Eng, South Africa
C43 on DM42 03818, 06199, WP43 pilot 0015. In box: HP42S, HP32Sii, WP34S&C, HP28C, HP35s, EL506P, ELW506, PB700; previous FX702P, 11C, HP67 & HP85; iOS: 42s Byron, Free42, WP31S/34S, HCalc.
Re: Show all digits of a huge integer
Nice one Jaymos.
First, I wanted to make a matrix with a 10 column row for each group of 10 digits, and use the matrix viewer, but found out, that there’s not enough RAM to make a 10x100 matrix.
Then I wanted to simply make a long string and use that to store all digits, but strings can not be 1000 chars long.
I have another idea, hope I get the time to implement it, but right now, there’s something else taking my attention, clear skies and C/2022 E3 (ZTF)
First, I wanted to make a matrix with a 10 column row for each group of 10 digits, and use the matrix viewer, but found out, that there’s not enough RAM to make a 10x100 matrix.
Then I wanted to simply make a long string and use that to store all digits, but strings can not be 1000 chars long.
I have another idea, hope I get the time to implement it, but right now, there’s something else taking my attention, clear skies and C/2022 E3 (ZTF)
/Rudi
DM42 as C43 (s/n 06999), HP42S, HP35s, HP11c, HP32SII (ex HP41CV, ex HP75C, ex HP48G + a lot, really lot of a accessories)
DM42 as C43 (s/n 06999), HP42S, HP35s, HP11c, HP32SII (ex HP41CV, ex HP75C, ex HP48G + a lot, really lot of a accessories)