BeyondDouble is a Java library that provides arbitrary-precision decimal arithmetic operations using Taylor series approximations for complex mathematical functions. This implementation allows for mathematical computations beyond the limitations of primitive Java types, with configurable precision and multiple notation systems.
- Arbitrary Precision: Handle real numbers of virtually unlimited size (memory permitting)
- Multiple Notation Systems: Support for decimal point (1,234.56) and comma (1.234,56) formats
- Comprehensive Arithmetic Operations: Addition, subtraction, multiplication, division with precision control
- Taylor Series Implementation: Advanced mathematical functions using Taylor series expansions
- Type Conversion: Full implementation of Java Number primitive conversions
- JUnit 5 Testing: Comprehensive test suite with 90% code coverage using JaCoCo
- Docker Support: Pre-configured Docker and Docker Compose for containerized deployment
BeyondDouble utilizes Taylor series expansions to compute complex mathematical operations. The Taylor series of a function f(x) that is infinitely differentiable at a point a is given by:
f(x) = f(a) + f'(a)(x-a)/1! + f''(a)(x-a)²/2! + f'''(a)(x-a)³/3! + ... + fⁿ(a)(x-a)ⁿ/n! + ...
// Various construction methods
Digit a = new Digit("123.456"); // From string
Digit b = new Digit(123.456); // From double
Digit c = new Digit("123", "456", true); // From parts with notation
// Arithmetic operations
Digit result = a.add(b).multiply(c).divide(new Digit("2"), 64); // 64 decimal places precision- Java 17 or higher - Minimum version required to run the application
- Gradle 8.0+ - Build tool (included via Gradle Wrapper)
- Docker & Docker Compose (optional) - For containerized execution
- Java 17+
- Gradle 8.0+ (or use the included Gradle Wrapper)
# Clone the repository
git clone https://github.com/MaySalguedo/BeyondDouble.git
cd BeyondDouble
# Build the project with Gradle
./gradlew build
# Build on Windows
gradlew.bat build# Run all tests with JUnit 5
./gradlew test
# Run tests on Windows
gradlew.bat test
# Run with verbose output
./gradlew test --infoBeyondDouble enforces a minimum of 90% code coverage using JaCoCo.
# Generate JaCoCo coverage report
./gradlew jacocoTestReport
# On Windows
gradlew.bat jacocoTestReport
# View the HTML coverage report in your browser
# Open: build/reports/jacoco/test/html/index.htmlTo verify coverage meets the minimum threshold:
# Run coverage verification (fails if coverage < 90%)
./gradlew jacocoTestCoverageVerification
# On Windows
gradlew.bat jacocoTestCoverageVerification# Build the JAR file (skipping tests)
./gradlew jar
# JAR location: build/libs/BeyondDouble-1.0-SNAPSHOT.jar
# Or build with tests included
./gradlew build# Run the application directly
./gradlew run
# On Windows
gradlew.bat run
# Run a built JAR
java -jar build/libs/BeyondDouble-1.0-SNAPSHOT.jar# Build a Docker image
docker build -t beyonddouble:latest -f .github/docker/Dockerfile .
# Run the container
docker run --name beyonddouble beyonddouble:latest
# View logs
docker logs beyonddouble
# Remove the container after it exits
docker rm beyonddoubledocker-compose.yml currently points to the legacy root Dockerfile. Update it to use .github/docker/Dockerfile before relying on Compose for local runs.
# Start the application with Docker Compose
docker-compose up -d
# View logs
docker-compose logs -f app
# Stop the application
docker-compose downThe CI Docker image is defined in .github/docker/Dockerfile and uses Gradle inside the container.
The project uses Gradle with the following key plugins:
- Java Plugin - Standard Java compilation and testing
- Application Plugin - For running the application directly
- JaCoCo Plugin - Code coverage measurement
- Checkstyle Plugin - Java source linting
Main application class: BeyondDouble.App
build
├── compile
├── test
├── verify (code coverage check - 90% minimum)
└── jar (assembly)
| Command | Description |
|---|---|
./gradlew build |
Clean build with tests and coverage verification |
./gradlew clean |
Clean build artifacts |
./gradlew checkstyleMain |
Lint Java source files |
./gradlew test |
Run unit tests |
./gradlew jacocoTestReport |
Generate coverage report |
./gradlew run |
Run the application |
./gradlew jar |
Build JAR file |
./gradlew --help |
Show all available tasks |
The project uses JUnit 5 (Jupiter) for testing with comprehensive test coverage:
- DigitTest.java - Core arithmetic operations
- TrigonometryTest.java - Taylor series implementations
- AppTest.java - Application entry point
Run tests with:
./gradlew test
# Run specific test class
./gradlew test --tests DigitTest
# Run with coverage report
./gradlew buildCoverage reports are located at: build/reports/jacoco/test/html/index.html
The project includes a GitHub Actions workflow at .github/workflows/ci.yml.
All jobs run inside Docker containers:
- Linting - Java-only Checkstyle linting with
./gradlew checkstyleMain - Testing - JUnit 5 tests with JaCoCo reports
- Building - Gradle package build and JAR artifact upload
- Docker - Docker image build and runtime smoke test
Branch behavior:
| Branch/Event | Jobs |
|---|---|
| Any branch | lint |
main or develop |
lint, test |
main |
lint, test, build, docker |
Pull request into develop |
lint, test |
Pull request into main |
lint, test, build, docker |
You can test GitHub Actions workflows locally using nektos/act.
# Feature branch push: lint only
act push -e .github/events/push-feature.json
# Develop branch push: lint and test
act push -e .github/events/push-develop.json
# Main branch push: lint, test, build, and docker
act push -e .github/events/push-main.json
# Pull request into develop: lint and test
act pull_request -e .github/events/pull-request-develop.json
# Pull request into main: lint, test, build, and docker
act pull_request -e .github/events/pull-request-main.json
# Run with verbose output
act -v
# List available jobs
act -lThe local event payloads are stored in .github/events/.
- Gradle 8.0+ (included via Gradle Wrapper)
- JDK 17+ (Java Development Kit)
- JDK 17+
- JUnit 5 (5.11.0) - JUnit Jupiter API, Engine, and Parameterized Tests
- JaCoCo 0.8.11 - Code coverage measurement
No external production dependencies - BeyondDouble is a lightweight library with minimal dependencies.
BeyondDouble is licensed under the Apache License 2.0. See LICENSE.md for details.
Contributions are welcome! Please ensure:
- Code passes all tests:
./gradlew test - Coverage meets 90% minimum:
./gradlew jacocoTestCoverageVerification - Java lint passes:
./gradlew checkstyleMain - Code is properly documented
- Commit messages are clear and descriptive
For issues, feature requests, or documentation improvements, please open an issue on GitHub.
Last Updated: June 2026 Build System: Gradle 8.0+ Java Version: 17