Services webmasters
Partenaires
Jeux concours gratuits
 
floor
<<<
fmod getrandmax
>>>

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.27 fmod() Retourne le reste de la division

[ Exemples avec fmod ]   PHP 4 >= 4.2.0

float  fmod ( float   x , float   y )

fmod retourne le reste de la division de ( x ) par ( y ). Ce reste est un nombre à virgule flottante. Le reste est défini par : x = i * y + r, pour un entier i . Si y n'est pas nul, r a le même signe que x est une taille inférieure à y .

Exemple avec fmod

$x = 5.7;
$y = 1.3;
$r = fmod($x, $y);
// $r égale 0.5, car 4 * 1.3 + 0.5 = 5.7

<< fmod >>
floor Mathématiques getrandmax
Services webmasters
Les manuels
 
CoursPHP.com - Reproduction interdite -