Calculating pi without arbitrary precision and only basic arithmetic

Nico A

I want to calculate pi. But, I have quite a few limits. Variables can only hold up to 5 decimal places, and I only have the following operators:

Addition
Subtraction
Multiplication
Division
Exponents
Square roots
Sin
Cos
Basic Loops, Conditionals, and relational operators.

The BBP algorithm seems useless here, because even though it would not need arbitrary precision, I cannot convert between bases. I'm not aware of any other formulas that can find the nth digit of pi in base 10. Would it even be possible to calculate pi using these constraints?

Phillip

BBP can be modified to give π in Base 10. There's a Java implementation on Github. (I believe that the screenshot of the algorithm description is taken from Pi - Unleashed by Arndt/Haenel.)

You'll need the modulo operation and a means to calculate the closest integer to the logarithm of a number, but you can perform them using the operations you have and loops.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Java

Approximating cosine on [0,pi] using only single precision floating point

From Dev

LLVM arbitrary precision integer

From Dev

Calculating Pi Java Program

From Dev

Arbitrary precision arithmetic with very big factorials

From Dev

Fixed precision vs. arbitrary precision

From Dev

Basic arithmetic on two byte arrays in Java without BigInteger

From Dev

Python mpmath not arbitrary precision?

From Dev

SSRS basic arithmetic failures

From Dev

Calculating percentages in arbitrary number of columns

From Dev

Is it possible to achieve arbitrary-precision arithmetic with no rounding issues in JavaScript?

From Dev

BBP-Algorithm in Python - Working with Arbitrary-precision arithmetic

From Dev

arbitrary floating precision number to string

From Dev

calculating accuracy and precision for multiclass system

From Dev

Calculating the sine of pi with php

From Dev

Calculating pi without arbitrary precision and only basic arithmetic

From Dev

awk high precision arithmetic

From Dev

"Multiplication of Arbitrary Precision Numbers" in Scheme

From Dev

Arbitrary precision arithmetic with very big factorials

From Dev

Losing precision (using GMP) when calculating pi with sequential bbp

From Dev

LLVM arbitrary precision integer

From Dev

Calculating PI with Fortran & CUDA

From Dev

awk high precision arithmetic

From Dev

calculating accuracy and precision for multiclass system

From Dev

Unable to perform basic arithmetic

From Dev

Arithmetic precision problems with large numbers

From Dev

stripe node arbitrary precision number

From Dev

calculating arithmetic progression with recursion

From Dev

Calculating PI with an special Algorithm

From Dev

Calculate Pi with arbitrary precision digit by digit

Related Related

  1. 1

    Approximating cosine on [0,pi] using only single precision floating point

  2. 2

    LLVM arbitrary precision integer

  3. 3

    Calculating Pi Java Program

  4. 4

    Arbitrary precision arithmetic with very big factorials

  5. 5

    Fixed precision vs. arbitrary precision

  6. 6

    Basic arithmetic on two byte arrays in Java without BigInteger

  7. 7

    Python mpmath not arbitrary precision?

  8. 8

    SSRS basic arithmetic failures

  9. 9

    Calculating percentages in arbitrary number of columns

  10. 10

    Is it possible to achieve arbitrary-precision arithmetic with no rounding issues in JavaScript?

  11. 11

    BBP-Algorithm in Python - Working with Arbitrary-precision arithmetic

  12. 12

    arbitrary floating precision number to string

  13. 13

    calculating accuracy and precision for multiclass system

  14. 14

    Calculating the sine of pi with php

  15. 15

    Calculating pi without arbitrary precision and only basic arithmetic

  16. 16

    awk high precision arithmetic

  17. 17

    "Multiplication of Arbitrary Precision Numbers" in Scheme

  18. 18

    Arbitrary precision arithmetic with very big factorials

  19. 19

    Losing precision (using GMP) when calculating pi with sequential bbp

  20. 20

    LLVM arbitrary precision integer

  21. 21

    Calculating PI with Fortran & CUDA

  22. 22

    awk high precision arithmetic

  23. 23

    calculating accuracy and precision for multiclass system

  24. 24

    Unable to perform basic arithmetic

  25. 25

    Arithmetic precision problems with large numbers

  26. 26

    stripe node arbitrary precision number

  27. 27

    calculating arithmetic progression with recursion

  28. 28

    Calculating PI with an special Algorithm

  29. 29

    Calculate Pi with arbitrary precision digit by digit

HotTag

Archive