Recherche sur les Noms des fonctions php/mysql
floor()
Définition
Arrondit à l'entier inférieur - (PHP 4, PHP 5)Description
float floor
( float $value
)
Retourne l'entier inférieur du nombre value .
Liste de paramètres
- number
-
La valeur numérique à arrondir
Valeurs de retour
floor() retourne l'entier inférieur du nombre value . La valeur retournée est un nombre à virgule flottante, (float) car ces nombres peuvent être plus grands que les entiers.
Exemples
Exemple #1 Exemple avec floor()
<?php
echo floor(4.3); // 4
echo floor(9.999); // 9
echo floor(-3.14); // -4
?>
Bouts de code utilisant la fonction floor()
<?php /* ... */
function minute_vers_heure($minute){
return sprintf('%02d:%02d', floor($minute/60), $minute%60);
}
/* ... */ ?>
<?php /* ... */
$q = floor($r/10);
$E = 10 - ($r - $q * 10);
if($E == "10") $E = "0";
/* ... */ ?>
<?php /* ... */
$x_t = $x_c;
$y_t = floor(($size[1]*$x_c)/$size[0]);
$x_p = 0;
/* ... */ ?>
<?php /* ... */
for ($i = 0; $i < strlen($this->emailaddy); $i = $i + 1) {
$j = floor(rand(0, 1+$mailto));
if ($j==0) {
/* ... */ ?>
<?php /* ... */
if($this->hAlign==POSITION_MIDDLE){
$stampX = floor(($imageWidth/2)-($stampWidth/2));
}elseif($this->hAlign==POSITION_RIGHT){
/* ... */ ?>
Connexion
Les fonctions
Références
- abs
- acos
- acosh
- asin
- asinh
- atan2
- atan
- 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
- log10
- log1p
- log
- max
- min
- mt_getrandmax
- mt_rand
- mt_srand
- octdec
- pi
- pow
- rad2deg
- rand
- round
- sin
- sinh
- sqrt
- srand
- tan
- tanh





