mehulthakral / intal

It is a library of nonnegative integer of arbitrary length(up to 1000 decimal digits) and supports operations like multiplication, addition, subtraction, etc of large numbers which by default is supported in languages like Python, Java and is missing in C.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

intal

Problem Statement

Develop a C library for the integers of arbitrary length (intal).

intal

An intal is a nonnegative integer of arbitrary length, but it is sufficient for your implementation to support up to 1000 decimal digits. The integer is stored as a null-terminated string of ASCII characters. An intal is represented as a string of decimal digits ('0' thru '9') that are stored in the big-endian style. That is, the most significant digit is at the head of the string. An integer 25, for example, is stored in a string s as '2' at s[0], '5' at s[1], and null char at s[2].

Files

  1. PES1201701122.c is the implementation file, which has the definition of all the functions declared in the header file intal.h.
  2. You can use the intal_sampletest.c for the sanity check.
  3. Compile intal_sampletest.c with PES1201701122.c to sanity-check your implementation.

Commands

prompt> ls
op> intal.h intal_sampletest.c PES1201701122.c

prompt> gcc -Wall PES1201701122.c intal_sampletest.c -o mytest.out

prompt> ./mytest.out

Operations

  1. Addition
  2. Subtraction
  3. Multiplication
  4. Comparing
  5. Modulus
  6. Power
  7. GCD
  8. Fibonacci
  9. Factorial
  10. Binomial Coefficient
Array Operations
  1. Min
  2. Max
  3. Linear Search
  4. Binary Search
  5. Sort

About

It is a library of nonnegative integer of arbitrary length(up to 1000 decimal digits) and supports operations like multiplication, addition, subtraction, etc of large numbers which by default is supported in languages like Python, Java and is missing in C.


Languages

Language:C 100.0%