How murthy-manideep/arbitrary_precision_arithmetic works
Project type and purpose
• This is an open-source arbitrary-precision arithmetic library/tool written in Java, with:
• Core library (AInteger, AFloat) packaged as aarithmetic.jar
• A Java CLI wrapper (MyInfArith.java)
• A Python CLI script (python_script.py) offering equivalent operations
• Build automation via Ant (build.xml)
• Containerization via Dockerfile
• Purpose: perform addition, subtraction, multiplication, division on integers and floats of arbitrary size/precision without rounding errors.
File structure
• Top-level artifacts:
– Dockerfile: builds a container image
– build.xml: Ant build script
– arbitraryarithmetic/aarithmetic.jar: compiled library
– python_script.py: Python wrapper
– JavaSrc/arbitraryarithmetic (AFloat.java, AInteger.java): core classes
– JavaSrc/MyInfArith.java: Java CLI front-end
– Report/: design artifacts (not part of runtime)
• Packaging pattern:
– Core library packaged in arbitraryarithmetic namespace
– CLI adapters (Java & Python) depend on core library
– Build & packaging orchestrated by Ant and Docker
Extract architectural insights from README
• Core modules: AInteger (integer ops), AFloat (floating-point ops)
• CLI entrypoints: MyInfArith (Java), Script.py (Python)
• Library artifact: aarithmetic.jar for third-party Java projects
• Deployment: run locally via Java/Python, or inside Docker container
Components & Interactions
a. Main components
• User (Dev or End-user)
• Java CLI Front-end (MyInfArith)
• Python CLI Front-end (python_script.py)
• Core Library (AInteger, AFloat) packaged in aarithmetic.jar
• Build System (Ant/build.xml)
• Docker container image
• External Java Projects (consuming the JAR)
b. Relationships & Data Flow
• User invokes Java CLI → calls Core Library → performs arithmetic → returns result
• User invokes Python CLI → either calls Core Library via subprocess or uses its own implementation → returns result
• Build System reads JavaSrc → compiles → outputs aarithmetic.jar + class files
• Dockerfile uses the build output to assemble a runtime image
• Third-party Java projects depend on aarithmetic.jar
c. Architectural patterns & design principles
• Modular packaging: separation of concerns between core library and CLI adapters
• OOP principles in the core (encapsulation, inheritance, polymorphism)
• Reusable library artifact (JAR) for integration
• Multiple interface adapters (Java & Python) demonstrating extensibility
d. Key technologies
• Java (JDK)
• Ant (build.xml)
• Docker
• Python 3