library to support of arithmetics for very big numbers

The library to support of arithmetics for very big numbers

License

License

GroupId

GroupId

com.github.javadev
ArtifactId

ArtifactId

verylargenumber
Last Version

Last Version

1.0
Release Date

Release Date

Type

Type

jar
Description

Description

library to support of arithmetics for very big numbers
The library to support of arithmetics for very big numbers
Project URL

Project URL

https://github.com/javadev/verylargenumber
Source Code Management

Source Code Management

https://github.com/javadev/verylargenumber

Download verylargenumber

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.javadev/verylargenumber/ -->
<dependency>
    <groupId>com.github.javadev</groupId>
    <artifactId>verylargenumber</artifactId>
    <version>1.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.javadev/verylargenumber/
implementation 'com.github.javadev:verylargenumber:1.0'
// https://jarcasting.com/artifacts/com.github.javadev/verylargenumber/
implementation ("com.github.javadev:verylargenumber:1.0")
'com.github.javadev:verylargenumber:jar:1.0'
<dependency org="com.github.javadev" name="verylargenumber" rev="1.0">
  <artifact name="verylargenumber" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.javadev', module='verylargenumber', version='1.0')
)
libraryDependencies += "com.github.javadev" % "verylargenumber" % "1.0"
[com.github.javadev/verylargenumber "1.0"]

Dependencies

test (1)

Group / Artifact Type Version
junit : junit jar 4.3.1

Project Modules

There are no modules declared in this project.

verylargenumber

Maven Central Build Status Coverage Status

This library theoretically may support arithmetics for numbers with any number of digits, even thousands or millions (the number of digits is limited by abilities of client's JVM). This is simple implementation of school arithmetics rules and nothing more.

This library is named "Slowpoke" in honor of famous pokemon and because it's implementation is really slow and ugly, because author have not mattered about performance, memory consumption and multithreading in the 1st version. But real problem will be exposed by future stress tests.

How to use it?

Very simple:

String addResultStr = VeryLargeNumber.add(arg1Str, arg2Str);

String subResultStr = VeryLargeNumber.sub(arg1Str, arg2Str);

String mulResultStr = VeryLargeNumber.mul(arg1Str, arg2Str);

String divResultStr = VeryLargeNumber.div(arg1Str, arg2Str);

int compareResult = VeryLargeNumber.compareAbs(arg1Str, arg2Str);

If compareResult is zero, then numbers are equal. If compareResult is less than zero, the 1st number is less then 2nd. If compareResult is greater than zero, the 1st number is greater then 2nd.

In every case if argument is not parsable decimal number, it is treated as zero. If you try to divide by zero, method throws an exception.

Versions

Version
1.0