Skip to content

Implemented BigInt, Complex No, Fractions in C

Notifications You must be signed in to change notification settings

itspunkaj/BigInt_in_C

 
 

Repository files navigation


CS201- DSA Project || Project Title : BIGINT & Calculation of PI || Instructor : Dr. Anil Shukla || Mentor : Avadhesh Gaur

Anant Prakash Singh - 2021CSB1066
Pankaj Singh - 2021CEB1026 Aditya Kumar Sahu - 2021MCB1228


  1. How to run file?

    • Just download the file on your device and open main.c
    • It is a C-programme so it can be run using gcc compiler on any device.
  2. What to input?

    • You will get a proper user prompt on running the main.c file.
  3. What to expect as a result?

    • According to the operation you will prompt the code will fetch you corresponding results.

BIG INT

License

Introduction

This repository contains the code for the implementation of a self-designed data structure called BIGINT. It also includes utility functions for complex numbers and fractions. The primary objective of the project is to find the value of 𝜋 (pi) up to 10000 decimal places using the Chudnovsky algorithm.

Equations

The project utilizes the Newton-Raphson method for root convergence and the Chudnovsky algorithm to compute the value of pi. Detailed explanations of these algorithms can be found in the documentation.

Functions & Operations

The repository provides various functions and operations including:

  • Basic Operations on Big Integers: Addition, Subtraction, Multiplication, Division, Decimal Division, Remainder (Modulo), GCD, Power, and Factorial.
  • Operations on Complex Numbers: Addition, Subtraction, Multiplication, Division, and Conjugate.
  • Operations on Fractions: Addition, Subtraction, Multiplication, Division, and Reduction to Simplest Form.
  • Computation of pi: Using the Chudnovsky algorithm.
  • Miscellaneous: Set Decimal Precision and Exit the program.

Output

The repository includes an output image demonstrating the program's functionality and accuracy in calculating pi.

Output Image

Tables

The tables in the documentation showcase the benchmarks for calculating the value of pi and the square root of 10005 with varying levels of precision.

Conclusions

The project successfully implements the BIGINT data structure and performs arithmetic operations on large integers. It also computes the value of pi using the Chudnovsky algorithm up to 10000 decimal places.

Acknowledgements

We would like to express our gratitude to our Course Instructor (Dr. Anil Shukla) and Mentor (Avadhesh Gaur) for their guidance and support throughout this project. We also extend our thanks to our parents and friends for their valuable feedback and encouragement.

References

The project references various online sources, including Wikipedia, CP-Algorithms, Algorithmica, and PlanetMath.

License

This project is licensed under the MIT License.

About

Implemented BigInt, Complex No, Fractions in C

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 100.0%