Services webmasters
Partenaires
Jeux concours gratuits
 
Constantes prédefinies
<<<
abs acos
>>>

7.50 Mathématiques
7 Index des fonctions
 Manuel PHP

Introduction
Pré-requis
Installation
Configuration à l'exécution
Types de ressources
Constantes prédefinies
->abs
acos
acosh
asin
asinh
atan
atan2
atanh
base_convert
bindec
ceil
cos
cosh
decbin
dechex
decoct
deg2rad
exp
expm1
floor
fmod
getrandmax
hexdec
hypot
is_finite
is_infinite
is_nan
lcg_value
log
log10
log1p
max
min
mt_getrandmax
mt_rand
mt_srand
octdec
pi
pow
rad2deg
rand
round
sin
sinh
sqrt
srand
tan
tanh

7.50.7 abs()Valeur absolue

[ Exemples avec abs ]   PHP 3, PHP 4

mixed  abs ( mixed   number )

abs retourne la valeur absolue du nombre number . Si le nombre est un nombre à virgule flottante ( float ), le type retourné est aussi un nombre à virgule flottante ( float ), sinon, c'est un entier ( integer ).

Exemple avec abs

$abs = abs(-4.2); // $abs = 4.2; (double/float)
$abs2 = abs(5);   // $abs2 = 5; (integer)
$abs3 = abs(-5);  // $abs3 = 5; (integer)

<< abs >>
Constantes prédefinies Mathématiques acos
Services webmasters
Les manuels
 
CoursPHP.com - Reproduction interdite -