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 (x)
Заменяет очень малое число нулём.
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 (x)
Возвращает знаменатель рационального числа.
See Wikipedia for more information.
FractionalPart (x)
Возвращает дробную часть числа.
See Wikipedia for more information.
Im (z)
Синонимы: ImaginaryPart
Get the imaginary part of a complex number. For example Re(3+4i)
yields 4.
See Wikipedia for more information.
IntegerQuotient (m,n)
Деление без остатка.
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 (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 (num)
Check if argument is a real floating point number (non-complex).
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 (num)
Проверяет, является ли аргумент целым числом (не комплексным).
IsNonNegativeInteger (num)
Check if argument is a non-negative real integer. That is, either a positive integer or zero.
IsPositiveInteger (num)
Синонимы: IsNaturalNumber
Проверяет, является ли аргумент положительным действительным целым числом. Обратите внимание, что мы придерживаемся соглашения о том, что 0 не является натуральным числом.
IsRational (num)
Проверяет, является ли аргумент рациональным числом (не комплексным). Разумеется, «рациональное» означает просто «не хранящееся в виде числа с плавающей точкой».
IsReal (num)
Проверяет, является ли аргумент действительным числом.
Numerator (x)
Возвращает числитель рационального числа.
See Wikipedia for more information.
Re (z)
Синонимы: RealPart
Get the real part of a complex number. For example Re(3+4i)
yields 3.
See Wikipedia for more information.
Sign (x)
Синонимы: sign
Возвращает знак числа. То есть, возвращает -1
, если значение отрицательно, 0
, если рано нулю и 1
, если значение положительно. Если x
— комплексное число, то Sign
возвращает направление на числовой оси (положительное или отрицательное) или 0.
ceil (x)
Синонимы: Ceiling
Возвращает наименьшее целое число, которое больше или равно n
. Примеры:
genius>
ceil(1.1)
= 2genius>
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 (x)
Экспоненциальная функция. Это функция e^x
, где e
— основание натурального логарифма.
See Wikipedia or Planetmath or Mathworld for more information.
float (x)
Возвращает представление числа x
в виде числа с плавающей точкой.
floor (x)
Синонимы: Floor
Возвращает наибольшее целое число, которое меньше или равно n
.
ln (x)
Натуральный логарифм (логарифм по основанию e
).
See Wikipedia or Planetmath or Mathworld for more information.
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 (x)
Логарифм x
по основанию 10.
log2 (x)
Синоним: lg
Логарифм x
по основанию 2.
max (a,args...)
Псевдонимы: Max
Maximum
Возвращает максимальный из аргументов или элементов матрицы.
min (a,args...)
Псевдонимы: Min
Minimum
Возвращает минимальный из аргументов или элементов матрицы.
rand (size...)
Генерирует случайное число с плавающей точкой в диапазоне [0,1)
. Если задан аргумент size, то может возвращать матрицу (если указано два числа) или вектор (если указано одно число) заданной размерности.
randint (max,size...)
Генерирует случайное целое число в диапазоне [0,max)
. Если задан аргумент size, возвращает матрицу (если указано два числа) или вектор (если указано одно число) заданной размерности. Например,
genius>
randint(4)
= 3genius>
randint(4,2)
= [0 1]genius>
randint(4,2,3)
= [2 2 1 0 0 3]
round (x)
Синонимы: Round
Округляет число.
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.41421356237genius>
sqrt(-1)
= 1igenius>
sqrt(4) mod 7
= [2 5]genius>
2*2 mod 7
= 4
See Wikipedia or Planetmath for more information.
trunc (x)
Синонимы: Truncate
IntegerPart
Усекает число до целого (возвращает целую часть).