ArbitraryArithmetic is a Java-based library and CLI tool for performing arithmetic operations on integers and floating-point numbers with infinite precision. It bypasses the limitations of Java's native numeric types by using string-based arithmetic.
- Infinite-precision support for:
- Integers (
AInteger.java) - Floating-point numbers (
AFloat.java)
- Integers (
- Operations:
- Addition (
add) - Subtraction (
sub) - Multiplication (
mul) - Division (
div)
- Addition (
- Java CLI runner:
MyInfArith.java - Apache Ant-based build automation
- Docker support
- Python helper script for compiling, JAR creation, and CLI execution
ant compileant run -Dtype=<int|float> -Dop=<add|sub|mul|div> -Darg1=<num1> -Darg2=<num2>ant cleanThis script compiles source files, creates the JAR, and optionally runs the program if arguments are passed.
python3 script.pypython3 script.py int mul 123456789 987654321Automatically compiles and creates the JAR at
build/aarithmetic.jarbefore running.
docker build -t java_project .docker run --rm java_project float div 244727.15202 75964.3891java -cp build MyInfArith int add 1234567891234567898883 9876543219876388854321