up previous next
4.2.5 Commands and Functions for Numbers
***** NOT YET UPDATED TO CoCoA-5: follow with care *****

The following are commands and functions for numbers:

INTEGERS
abs absolute value of a number
BinExp binomial expansion
binomial binomial coefficient
den denominator
div quotient for integers
EvalBinExp binomial expansion functions
EvalHilbertFn evaluate the Hilbert function
factorial factorial function
Fraction returns the quotient of its arguments
gcd greatest common divisor
GCDFreeBasis determine (minimal) GCD free basis of a set of integers
GenericPoints random projective points
ILogBase integer part of the logarithm
inverse multiplicative inverse
iroot integer part of r-th root of an integer
IsEven, IsOdd test whether an integer is even or odd
IsNumber checks if the argument is a number
IsPrime prime integer test
IsProbPrime checks if an integer is a probable prime
isqrt (truncated) square root of an integer
IsZero test whether an object is zero
lcm least common multiple
len the length of an object
Max a maximum element of a sequence or list
Min a minimum element of a sequence or list
mod remainder for integers
Mod2Rat reconstructing rationals from modular integers
NextPrime find the next largest prime number
NextProbPrime find the next largest probable prime number
num numerator
partitions partitions of an integer
product the product of the elements of a list
random random integer
Seed seed for Rand
Size the amount of memory used by an object
sum the sum of the elements of a list


RATIONALS
abs absolute value of a number
CFApprox continued fractions
CFApproximants continued fractions
ContFrac continued fractions denominators
ContFracToRat convert continued fraction to rational
DecimalStr convert rational number to decimal string
den denominator
FloatApprox approx. of rational number of the form M*10^E
FloatStr convert rational number to a float string
Fraction returns the quotient of its arguments
ILogBase integer part of the logarithm
inverse multiplicative inverse
IsNumber checks if the argument is a number
IsZero test whether an object is zero
MantissaAndExponent convert rational number to a float
Max a maximum element of a sequence or list
Min a minimum element of a sequence or list
num numerator
product the product of the elements of a list
sum the sum of the elements of a list


MODULAR INTEGERS
Fraction returns the quotient of its arguments
inverse multiplicative inverse
IsNumber checks if the argument is a number
IsZero test whether an object is zero
Mod2Rat reconstructing rationals from modular integers
product the product of the elements of a list
sum the sum of the elements of a list


For details look up each item by name. Online, try ?ItemName or H.Syntax("ItemName") .