Logo GenPRES

BigInteger Module

Calculates the greatest common divisor and least common multiple of big integers and generates a Farey sequence.

Functions and values

Function or value Description

BigInteger.farey n asc

Full Usage: BigInteger.farey n asc

Parameters:
Returns: (BigInteger * BigInteger) seq

Calculate an ordered farey sequence

n : BigInteger
asc : bool
Returns: (BigInteger * BigInteger) seq

BigInteger.fromInt x

Full Usage: BigInteger.fromInt x

Parameters:
    x : int

Returns: bigint

Create a bigint from an int

x : int
Returns: bigint

BigInteger.gcd a b

Full Usage: BigInteger.gcd a b

Parameters:
    a : bigint
    b : bigint

Returns: BigInteger

Calculate the greatest common divisor of two bigints Example: gcd 2I 4I returns 2I

a : bigint
b : bigint
Returns: BigInteger

BigInteger.gcdSeq xs

Full Usage: BigInteger.gcdSeq xs

Parameters:
    xs : bigint seq

Returns: BigInteger

Calculate the greatest common divisor of a sequence of bigints Example: gcdSeq [2I; 4I; 6I] returns 2I

xs : bigint seq
Returns: BigInteger

BigInteger.lcm a b

Full Usage: BigInteger.lcm a b

Parameters:
    a : bigint
    b : bigint

Returns: BigInteger

Calculate the least common multiple of two bigints Example: lcm 2I 4I returns 4I

a : bigint
b : bigint
Returns: BigInteger

BigInteger.lcmSeq xs

Full Usage: BigInteger.lcmSeq xs

Parameters:
    xs : bigint seq

Returns: BigInteger

Calculate the least common multiple of a sequence of bigints Example: lcmSeq [2I; 4I; 6I] returns 12I

xs : bigint seq
Returns: BigInteger

BigInteger.toInt x

Full Usage: BigInteger.toInt x

Parameters:
    x : bigint

Returns: int

Create an int from a bigint

x : bigint
Returns: int

Type something to start searching.