Skip to content

A calculator to calculate values beyond primitive data types capacity and display fully resolved number

Notifications You must be signed in to change notification settings

ParanoidBat/InfiniteCalculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 

Repository files navigation

Note: Not technically an infinite calculator, but it can calculate and display fully resolved result of large, really large numbers.

Infinite Calculator is an arithmatic calculator to calculate values that primitive containers cannot hold and it can display fully resolved numbers instead of converting them in exponents (eg: 1.12345e8). It can calculate numbers beyond big int (8 bytes) capacity, the actual limit depends on the available memory.

What it calculates

It supports basic arithmatic functions of

  • Addition
  • Subtraction
  • Multiplication
  • Division

Also supports the following, with their actual precendance

  • Paranthesis ()
  • Braces {}
  • Square Brackets []

What are the limitations

Even though the result depends on the available memory, the actual string input expression can only have the length upto 2^31. Also the calculator follows the precedence rules of BODMAS (Brackets Of Division Multiplication Addition Subtraction).
When designing the input, care must be taken to follow the bracket precedance rules, no whole number should start with a 0 and no whitespaces must be introduced in the input string.
Failing to follow the above rules will produce invalid results. Where these cases could've been handled, I was interested in building the calclutor but not so much in making it fault tolerant, you are welcome to contribute to make it as such.

It takes command line argument as an input. Though you also could just use an IDE and edit the input variable in the code.

About

A calculator to calculate values beyond primitive data types capacity and display fully resolved number

Topics

Resources

Stars

Watchers

Forks

Languages