-3

I have a problem when it comes to calculating pi with more than 15 decimal places(i used double).

My result looks quite good except my variable is limited to 15 decimal places:

3.140592653839794

Anybody could tell me what i have to do if i want more decimal places?

Thanks and Greeting!

Creative crypter
  • 1,348
  • 6
  • 30
  • 67

1 Answers1

4

Use java.math.BigDecimal instead of double for arbitrary (finite) precision.

StackFlowed
  • 6,664
  • 1
  • 29
  • 45