Is it possible to find the nearest exact form of an irrational number if the decimal number is given? Suppose i only have $6$ digits i.e. $3.14159$ the output should tell me one of the possibilities is $\pi$. I don't have any attempts since i have no idea how to do this. Hope you can help me.
Asked
Active
Viewed 42 times
0
x,Rationalize[x]will put it into exact rational form. Of course, there is no decimal representation of $\pi$ that can be stored on a computer, and as @DanielHuber says, there is no rational number closest to any irrational number. – thorimur Mar 23 '21 at 04:11Pi:x = 3.14159; Pi*Round[x/Pi, 10^-5]orx = 1.5708; Pi*Round[x/Pi, 10^-5]– Bob Hanlon Mar 23 '21 at 06:20