Числовые

AbsoluteValue
AbsoluteValue (x)

Синонимы: abs

Absolute value of a number and if x is a complex value the modulus of x. I.e. this the distance of x to the origin. This is equivalent to |x|.

See Wikipedia, Planetmath (absolute value), Planetmath (modulus), Mathworld (absolute value) or Mathworld (complex modulus) for more information.

Chop
Chop (x)

Заменяет очень малое число нулём.

ComplexConjugate
ComplexConjugate (z)

Aliases: conj Conj

Calculates the complex conjugate of the complex number z. If z is a vector or matrix, all its elements are conjugated.

See Wikipedia for more information.

Denominator
Denominator (x)

Возвращает знаменатель рационального числа.

See Wikipedia for more information.

FractionalPart
FractionalPart (x)

Возвращает дробную часть числа.

See Wikipedia for more information.

Im
Im (z)

Синонимы: ImaginaryPart

Get the imaginary part of a complex number. For example Re(3+4i) yields 4.

See Wikipedia for more information.

IntegerQuotient
IntegerQuotient (m,n)

Деление без остатка.

IsComplex
IsComplex (num)

Check if argument is a complex (non-real) number. Do note that we really mean nonreal number. That is, IsComplex(3) yields false, while IsComplex(3-1i) yields true.

IsComplexRational
IsComplexRational (num)

Check if argument is a possibly complex rational number. That is, if both real and imaginary parts are given as rational numbers. Of course rational simply means "not stored as a floating point number."

IsFloat
IsFloat (num)

Check if argument is a real floating point number (non-complex).

IsGaussInteger
IsGaussInteger (num)

Aliases: IsComplexInteger

Check if argument is a possibly complex integer. That is a complex integer is a number of the form n+1i*m where n and m are integers.

IsInteger
IsInteger (num)

Проверяет, является ли аргумент целым числом (не комплексным).

IsNonNegativeInteger
IsNonNegativeInteger (num)

Check if argument is a non-negative real integer. That is, either a positive integer or zero.

IsPositiveInteger
IsPositiveInteger (num)

Синонимы: IsNaturalNumber

Проверяет, является ли аргумент положительным действительным целым числом. Обратите внимание, что мы придерживаемся соглашения о том, что 0 не является натуральным числом.

IsRational
IsRational (num)

Проверяет, является ли аргумент рациональным числом (не комплексным). Разумеется, «рациональное» означает просто «не хранящееся в виде числа с плавающей точкой».

IsReal
IsReal (num)

Проверяет, является ли аргумент действительным числом.

Numerator
Numerator (x)

Возвращает числитель рационального числа.

See Wikipedia for more information.

Re
Re (z)

Синонимы: RealPart

Get the real part of a complex number. For example Re(3+4i) yields 3.

See Wikipedia for more information.

Sign
Sign (x)

Синонимы: sign

Возвращает знак числа. То есть, возвращает -1, если значение отрицательно, 0, если рано нулю и 1, если значение положительно. Если x — комплексное число, то Sign возвращает направление на числовой оси (положительное или отрицательное) или 0.

ceil
ceil (x)

Синонимы: Ceiling

Возвращает наименьшее целое число, которое больше или равно n. Примеры:

genius> ceil(1.1)
= 2
genius> ceil(-1.1)
= -1

Note that you should be careful and notice that floating point numbers are stored in binary and so may not be what you expect. For example ceil(420/4.2) returns 101 instead of the expected 100. This is because 4.2 is actually very slightly less than 4.2. Use rational representation 42/10 if you want exact arithmetic.

exp
exp (x)

Экспоненциальная функция. Это функция e^x, где eоснование натурального логарифма.

See Wikipedia or Planetmath or Mathworld for more information.

float
float (x)

Возвращает представление числа x в виде числа с плавающей точкой.

floor
floor (x)

Синонимы: Floor

Возвращает наибольшее целое число, которое меньше или равно n.

ln
ln (x)

Натуральный логарифм (логарифм по основанию e).

See Wikipedia or Planetmath or Mathworld for more information.

log
log (x)
log (x,b)

Logarithm of x base b (calls DiscreteLog if in modulo mode), if base is not given, e is used.

log10
log10 (x)

Логарифм x по основанию 10.

log2
log2 (x)

Синоним: lg

Логарифм x по основанию 2.

max
max (a,args...)

Псевдонимы: MaxMaximum

Возвращает максимальный из аргументов или элементов матрицы.

min
min (a,args...)

Псевдонимы: MinMinimum

Возвращает минимальный из аргументов или элементов матрицы.

rand
rand (size...)

Генерирует случайное число с плавающей точкой в диапазоне [0,1). Если задан аргумент size, то может возвращать матрицу (если указано два числа) или вектор (если указано одно число) заданной размерности.

randint
randint (max,size...)

Генерирует случайное целое число в диапазоне [0,max). Если задан аргумент size, возвращает матрицу (если указано два числа) или вектор (если указано одно число) заданной размерности. Например,

genius> randint(4)
= 3
genius> randint(4,2)
=
[0      1]
genius> randint(4,2,3)
=
[2      2       1
 0      0       3]
round
round (x)

Синонимы: Round

Округляет число.

sqrt
sqrt (x)

Синонимы: 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 Wikipedia or Planetmath for more information.

trunc
trunc (x)

Синонимы: TruncateIntegerPart

Усекает число до целого (возвращает целую часть).