Nombres

AbsoluteValue
AbsoluteValue (x)

Alias : 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)

Remplace les très petits nombres par zéro.

ComplexConjugate
ComplexConjugate (z)

Alias : conj Conj

Calcule le conjugué du nombre complexe z. Si z est un vecteur ou une matrice, tous les éléments sont conjugués.

See Wikipedia for more information.

Denominator
Denominator (x)

Renvoie le dénominateur d'un nombre rationnel.

See Wikipedia for more information.

FractionalPart
FractionalPart (x)

Renvoie la partie fractionnelle d'un nombre.

See Wikipedia for more information.

Im
Im (z)

Alias : 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)

Division sans reste.

IsComplex
IsComplex (nbre)

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 (nbre)

Vérifie si l'argument est potentiellement un nombre rationnel complexe. C'est-à-dire si la partie réelle et la partie imaginaire sont fournies sous la forme de nombres rationnels. Bien sûr, rationnel signifie simplement « non enregistré comme un nombre à virgule flottante ».

IsFloat
IsFloat (nbre)

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

IsGaussInteger
IsGaussInteger (nbre)

Alias : 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 (nbre)

Vérifie si l'argument est un entier (non complexe).

IsNonNegativeInteger
IsNonNegativeInteger (nbre)

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

IsPositiveInteger
IsPositiveInteger (nbre)

Alias : IsNaturalNumber

Vérifie si l'argument est un entier réel positif. Notez que par convention 0 n'est pas un nombre naturel.

IsRational
IsRational (nbre)

Vérifie si l'argument est un nombre rationnel (non complexe). Bien sûr, rationnel signifie simplement « non enregistré comme un nombre à virgule flottante ».

IsReal
IsReal (nbre)

Vérifie si l'argument est un nombre réel.

Numerator
Numerator (x)

Renvoie le numérateur d'un nombre rationnel.

See Wikipedia for more information.

Re
Re (z)

Alias : RealPart

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

See Wikipedia for more information.

Sign
Sign (x)

Alias : sign

Renvoie le signe d'un nombre. C'est-à-dire renvoie -1 si la valeur est négative, 0 si la valeur est nulle et 1 si la valeur est positive. Si x est une grandeur complexe alors Sign renvoie la direction ou 0.

ceil
ceil (x)

Alias : Ceiling

Get the lowest integer more than or equal to n. Examples:

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)

La fonction exponentielle. C'est la fonction e^xe est la base du logarithme naturel.

See Wikipedia or Planetmath or Mathworld for more information.

float
float (x)

Transforme le nombre en nombre à virgule flottante. C'est-à-dire la représentation à virgule flottante du nombre x.

floor
floor (x)

Alias : Floor

Renvoie le plus grand entier inférieur ou égal à n.

ln
ln (x)

Le logarithme naturel, le logarithme de base 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)

Logarithme base 10 de x.

log2
log2 (x)

Alias : lg

Logarithme base 2 de x.

max
max (a,params...)

Alias : Max Maximum

Renvoie le maximum des arguments ou de la matrice.

min
min (a,params...)

Alias : Min Minimum

Renvoie le minimum des arguments ou de la matrice.

rand
rand (taille...)

Génère aléatoirement des nombres flottants dans l'intervalle [0,1). Si taille est donnée alors une matrice (si deux nombres sont fournis) ou un vecteur (si un seul est fourni) de la taille indiquée est renvoyé.

randint
randint (max,taille...)

Génère aléatoirement des entiers dans l'intervalle [0,max). Si taille est donné alors une matrice (si deux nombres sont fournis) ou un vecteur (si un seul est fourni) de la taille indiquée est renvoyé. Par exemple,

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

Alias : Round

Arrondit un nombre.

sqrt
sqrt (x)

Alias : SquareRoot

La racine carrée. Au cours de calculs en mode modulaire, certains entiers renvoient soit null ou un vecteur contenant les racines carrées. Exemples :

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)

Alias : TruncateIntegerPart

Tronque le nombre à un entier (renvoie la partie entière).