1
$\begingroup$

I try to calculate something like 1.569732312*Pi and by default mathematica returns something like 4.93146 (only 5 digits after floating point), but I believe there is much more digits, especially because Pi has infinite number of digits.

if I do like this

N[1.569732312*Pi, 50]

It still return the same 5 digits 4.93146

As I understand from documentation, I have to use Rationalize[]. If I do like this

N[Rationalize[1.569732312]*Pi, 50]

result is the same 4.93146

and only if I remove 3 digits like this

N[Rationalize[1.569732]*Pi, 50]

it gives me all digits like this

4.9314585193048133197984421233221006214165911156199

What I am doing wrong and how to calculate 1.569732312*Pi with 50 digits precision?

$\endgroup$
7
  • $\begingroup$ 1.569732312`50*Pi - note the backtick. See also here. $\endgroup$
    – corey979
    Commented Oct 31, 2016 at 22:18
  • $\begingroup$ Thanks a lot! Yes, if I put something like 1.569732312`50*Pi, it works fine. $\endgroup$
    – Zlelik
    Commented Oct 31, 2016 at 22:32
  • $\begingroup$ 1.569732312 is a machine double. What 50 digit result would you expect to get from that product? (If you want a 50 digit number that has 1.569732312 followed by decimal zeroes, the tactic of using 1.569732312`50 as proposed by @corey979 is appropriate). $\endgroup$ Commented Oct 31, 2016 at 22:33
  • $\begingroup$ I want to know the result of my equation. Like Pi=3.1415926...., If I multiple it by 2, it will be 6,2831852, but I want to know all 50 digits of this equation 2*Pi, because Pi has infinite digits. and later I want to change 2 to some different number. $\endgroup$
    – Zlelik
    Commented Oct 31, 2016 at 22:49
  • $\begingroup$ you should review the details section in the docs for Rationalize to learn whats happening there. $\endgroup$
    – george2079
    Commented Nov 1, 2016 at 0:55

1 Answer 1

1
$\begingroup$

It is about backtick. This example works fine

1.569732312`50*Pi
$\endgroup$
1
  • 1
    $\begingroup$ Similarly, 2.0`50*Pi gives 2*Pi to 50 dgits $\endgroup$
    – bill s
    Commented Oct 31, 2016 at 23:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.