# Is there a way to convert a high precision value to its digits?

Is there a way to convert a number like 2.532638417287037060215921976686465786639617879720.124930050805514*^-12 to a high precision integer?

Mathematica gives me only 20 digits with RealDigits[] when I do this but there are clearly more digits available.

Edit: I should have also stated that I need to do the conversion in Mathematica, not manually.

• For clarity, can you actually put Mathematica code in the body of your question? As it stands, I think I'm misunderstanding your question, because I can't evaluate that numeric expression as is. Sep 13, 2023 at 3:22
• It might also help to explain how you got that number. It looks like it's specifying a precision of 20 digits, and so I'm not sure why you expect any certainty in digits beyond 20. Sep 13, 2023 at 3:26
• So, "integer" was just a mistake, right? That number obviously can't be an integer. Sep 13, 2023 at 16:03
• Maybe what you want is SetPrecision, but given that your original number has a precision of about 20 digits, the digits beyond that after you use SetPrecision won't be reliable. Sep 13, 2023 at 16:05
• Can you maybe just include what result you actually want to see? Sep 13, 2023 at 16:08

Look at the precision of your numbe:r

num=2.532638417287037060215921976686465786639617879720.124930050805514*^-\
12;
Precision[num]

20.1249


By specifying "20.124930050805514" you decrease the precision explicitly. Delete this:

num = 2.5326384172870370602159219766864657866396178797*^-12;
Precision[num]

46.4036


And RealDigits will not deliver what you want:

RealDigits[num]

{2, 5, 3, 2, 6, 3, 8, 4, 1, 7, 2, 8, 7, 0, 3, 7, 0, 6, 0, 2, 1, 5, 9,
2, 1, 9, 7, 6, 6, 8, 6, 4, 6, 5, 7, 8, 6, 6, 3, 9, 6, 1, 7, 8, 7, 9,
7}, -11}

• That's understood but is there anyway to delete it with a Mathematica command. I get the sense that one Mathematica sets the precision there's no way to change it. Sep 13, 2023 at 13:23
• To delete the precision specification is best done with string manipulation . "SetPrecision" will change the precision. However, if you increase the precision, there will be some garbage in the unspecified digits. Sep 13, 2023 at 16:00

Yes, in Windows use Shift+Windows+S and copy your headline to clipboard. Paste it in Mathematica

bild=

Now you can recognize the number string

   TextRecognize[bild, Language -> "English"]

Is there a way to convert a number like
2.53263841728703706021592197668646578663961 78797 20.124930050805514*4-\ 12
to an high precision integer?


Given that the string is interpreted as intended

     Rationalize[(2.5326384172870370602159219766864657866396178797
20.124930050805514)^- 12, 10^-100]

1/307390781241935529806


or

Rationalize[(2.532638417287037060215921976686465786639617879720.124930050805514)
^- 12, 10^-100]

7045236/490652289593

• Unfortunately, In[58]:= N[ Rationalize[(2.532638417287037060215921976686465786639617879720.\ 124930050805514)^-12, 10^-100]] Out[58]= 0.0000143589 Sep 13, 2023 at 15:14