Learn R Programming

gmp (version 0.1)

gmp.add: Basic arithmetic operators for large integers

Description

Addition, substraction, multiplication, quotient of division, remainder of division and division.

Usage

gmp.add(a, b)
gmp.sub(a, b)
gmp.mul(a, b)
gmp.divq(a, b)
gmp.divr(a, b)
gmp.div(a, b)

Arguments

a
Integer or string from an integer
b
Integer or string from an integer

Value

  • A string of the integer value. gmp.div return a float (double).

References

Gnu MP Library see http://swox.com/gmp

Examples

Run this code
gmp.add(123131312,123131344)
gmp.sub(123131312,123131344)
gmp.mul(123131312,123131344)
gmp.divq(1234,400)
gmp.divr(1234,400)

Run the code above in your browser using DataLab