Using Rationalize to find the exact rational form [duplicate]

When I run

Rationalize[2.98688387095, 0]


I get $\frac{117300079}{39271724}$

However, when I run

N[117300079/39271724, 50]


I get

2.986883870949999546747680341204272060987


But what I really wanted was

2.986883870950000000000000000000000000000


How can I find the exact rational form of 2.98688387095?

marked as duplicate by Carl Woll, m_goldberg, Coolwater, Henrik Schumacher, J. M. will be back soon♦Apr 13 '18 at 7:10

• Per the linked question, you could try FromDigits @ RealDigits @ 2.98688387095. – Carl Woll Apr 13 '18 at 1:43
• As I explain in my answer to the question linked by Carl, Rationalize[num, 0] doesn't give an exact rational conversion. You instead need Rationalize[numz,0], where (simplifying from my answer) z>= twice the number of digits in the number. So, for your case, using a z of 100 (far more than enough), we have: x = Rationalize[2.98688387095100, 0] and N[x, 50] = 2.9868838709500000000.... – theorist Apr 13 '18 at 7:01