www.java-big.info
 Pure mathematics w/o unnecessary transformations




 The Big is a library of the most common mathematical functions with maximum accuracy for large numbers from arbitrary numerical systems.
 It is created in the simplest way in the Java programming language (several classes + one interface, w/o any other system classes and w/o recursion).
 The Big is FOSS = open source, free of charge, freely disseminated and without any guarantee.



    The functions overview:

NUMBERS
(Class name)

Type of

Natural+0
(Nat)

Integer
(Int)

Rational
(Rat)

Real
(Dec)

all
(Big)

Parameters

Result

Basic methods

Changing a numerical system

changeBase

s1, s2, x

z

Random value

rnd

s, xmax

z

Ludolf's number

pi

s

z

Euler's number

e

s

z

Apéry's number

zeta

s

z

Golden ratio

phi

s

z

Square root of two

sqrt2

s

z

Parity (EVEN/ODD)

parity

s, x

z

Compare two values

compareNat

compareInt

compareRat

compareDec

compare

s, x, y

c

Sum of two values

plusNat

plusInt

plusRat

plusDec

plus

s, x, y

z

Subtracting

minusNat

minusInt

minusRat

minusDec

minus

s, x, y

z

Multiplying one value by another

multiNat

multiInt

multiRat

multiDec

multi

s, x, y

z

Dividing one value to another

divNat

divInt

divRat

divDec

div

s, x, y

z

Rest after division

moduloInt

moduloRat

moduloDec

modulo

s, x, y

z

Power

powerRat

powerDec

power

s, x, y

z

Square root

sqrt

s, x, a

z

Root

root

s, x, y, a

z

Natural logarithm

ln

s, x, a

z

Natural exponential function ex

exp

s, x, a

z

Sine

sin

s, x, a

z

Cosine

cos

s, x, a

z

Factorial

factorial

»

»

»

s, x

z

Largest common divisor

gcd

»

»

»

s, x, y

z

Least common multiple

lcm

»

»

»

s, x, y

z

Absolute value

abs

»

»

»

x

z

Change +/- sign

neg

»

»

»

x

z

Returns a sign

signum

»

»

»

x

c

Test to zero

isZero

»

»

»

»

x

b

Auxiliary methods

Sum of ciphers

cipherSum

»

»

»

»

s, x

z

Returns the alphabet

getAbc

»

»

»

»

-

z

Sets the alphabet

setAbc

»

»

»

»

x

-

Returns a length of the alphabet

abcLength

»

»

»

»

-

i

Converts char to int

c2i

»

»

»

»

c

i

Converts int to a char

i2c

»

»

»

»

i

c

Natural number test

isNat

»

»

»

»

s, x

b

Test a number with the rest

isRat

»

»

»

»

s, x

b

Returns a numerator

numPart

»

»

»

»

x

z

Returns a denominator

denPart

»

»

»

»

x

z

Returns a whole part

intPart

»

»

»

x

z

Returns a decimal part

decPart

»

»

»

x

z

Returns a part with remainder

fractPart

»

»

»

x

z

Integer test

isInt

»

»

»

s, x

b

Converts Dec to Rat

dec2rat

»

»

s, x

z

Converts Dec to Rat

rat2dec

»

s, x, a

z

Rounds off a decimal number

round

»

s, x, a

z

Decimal number test

isDec

»

s, x

b

Modular inverse

modInv

s, x, y

z

Modular exponentiation

modPow

s, x1, x2, x3

z

Primality test

OBSOLETE, see WWW.PRIMULA.CLICK isPrime s, x b

Fix of redundant characters

check

s, x

z


Explanatory notes:     

 » = availability of the method through inheritance

 
int  i = an order number  (from the "numalphabet")
        a = accuracy   (in number of "decimal" places) 
        s = the base of a numerical system (radix)

 String  x, y = inputs numbers into a method
                  z = a result   (can be <NaN> or <INFINITY> in an error case)
     
 char   c = cipher (UTF-8)

 boolean   b = test result


 This library contains programming documentation and interesting examples of use
 (such as Shor's factorization algorithm for any numerical system and full RSA implementation).


    You can see, how the calculation speed is growing up during TestX from the examples in the highest numerical systems:

      

HW: DELL
OS: Win32

HW: ASUS
OS: Linux64

Graph 1

Graph 2



 The last version of The Big is here: Download

 Have a lot of fun with fabulous numbers!
    Yours Petr Svoboda
    info@java-big.info


© 2017 OK1PET, updated: 2019-11-14