Skip to content

Kyle0122/MultiPi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MultiPi

calculate Pi in multiple ways

Build

$make

Build and Run

$make run

About high percision number:

There are five function to calculate high percision number array: Add, multiply, divide, compareAbs.

In num.h, ARRAYLENGTH is the length of the array used to represent the percise number. N[0] is the sign of the number(-1 for minus and +1 for plus), N[1] is the integer part of the number, and the rest of the array is the decimal part, the last two numbers in the array is omitted sence they may be unprecice. In this way the total digit represent by the array is 5*(ARRAYLENGTH-4).

Note that there are some limits about the high percision number functions:

  1. In the divide(int* N, b) function, b should be less than or equal to 2^31/SCALE, which is 21474.
  2. In the multiply(int* N, b) function, b shoule be less than or equal to 2^31/SCALE, which is 21474
  3. the interger part has the maximum value of 2^31.

About

calculate Pi in multiple ways

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published