AbsoluteValue (x)
Aliases: abs
Absolute value of a number and if x
is
a complex value the modulus of x
.
See Planetmath (absolute value), Planetmath (modulus), Mathworld (absolute value) or Mathworld (complex modulus) for more information.
Chop (x)
Replace very small number with zero
ComplexConjugate (M)
Aliases: conj
Conj
Calculates the conjugate
Denominator (x)
Get the denominator of a rational number
FractionalPart (x)
Return the fractional part of a number
Im (z)
Aliases: ImaginaryPart
Get the imaginary part of a complex number
IntegerQuotient (m,n)
Division w/o remainder
IsComplex (num)
Check if argument is a complex (non-real) number
IsComplexRational (num)
Check if argument is a possibly complex rational number
IsFloat (num)
Check if argument is a floating point number (non-complex)
IsGaussInteger (num)
Aliases: IsComplexInteger
Check if argument is a possibly complex integer
IsGaussianInteger (z)
Check if argument is a gaussian integer
IsInteger (num)
Check if argument is an integer (non-complex)
IsNonNegativeInteger (num)
Check if argument is a non-negative real integer.
IsPositiveInteger (num)
Aliases: IsNaturalNumber
Check if argument is a positive real integer. Note that we accept the convention that 0 is not a natural number.
IsRational (num)
Check if argument is a rational number (non-complex)
IsReal (num)
Check if argument is a real number
Numerator (x)
Get the numerator of a rational number
Re (z)
Aliases: RealPart
Get the real part of a complex number
Sign (x)
Aliases: sign
Return the sign of a number. That is returns
-1 if value is negative,
0 if value is zero and
1 if value is positive. If x
is a complex
value then Sign
returns the direction or 0.
ceil (x)
Aliases: Ceiling
Get the lowest integer more than or equal to n
exp (x)
The exponential function. This is the function
e^x where e
is the base of the natural
logarithm.
See Planetmath or Mathworld for more information.
float (x)
Make number a floating point value. That is returns the floating point representation of the number x
.
floor (x)
Aliases: Floor
Get the highest integer less than or equal to n
ln (x)
The natural logarithm, the logarithm to base e
.
log (x,b...)
Logarithm of x
base b
(calls DiscreteLog
if in modulo mode), if base is not given, e
is used.
log10 (x)
Logarithm of x base 10
log2 (x)
Aliases: lg
Logarithm of x base 2
max (a,args...)
Aliases: Max
Maximum
Returns the maximum of arguments or matrix
min (a,args...)
Aliases: Min
Minimum
Returns the minimum of arguments or matrix
rand (size...)
Generate random float in the range [0,1). If size is given then a matrix (if two numbers are specified) or vector (if one number is specified) of the given size returned.
randint (max,size...)
Generate random integer in the range [0,max). If size is given then a matrix (if two numbers are specified) or vector (if one number is specified) of the given size returned. For example
genius> randint(4) = 3 genius> randint(4,2) = [0 1] genius> randint(4,2,3) = [2 2 1 0 0 3]
round (x)
Aliases: Round
Round a number
sqrt (x)
Aliases: SquareRoot
The square root. When operating modulo some integer will return either a null or a vector of the square roots. Examples:
genius> sqrt(2) = 1.41421356237 genius> sqrt(-1) = 1i genius> sqrt(4) mod 7 = [2 5] genius> 2*2 mod 7 = 4
See Planetmath for more information.
trunc (x)
Aliases: Truncate
IntegerPart
Truncate number to an integer (return the integer part)