SommaireTelecharger la documentationChapitre suivantChapitre precedent  

  .: News :.: Edito :.: Scripts :.: Forum :.: Erreurs :.: Jobs :. 
 
Sommaire

Mathématiques

Introduction
Abs
Acos
acosh
Asin
asinh
Atan
Atan2
atanh
base_convert
BinDec
Ceil
Cos
cosh
DecBin
DecHex
DecOct
deg2rad
Exp
Floor
getrandmax
hexdec
lcg_value
Log
Log10
max
min
mt_rand
mt_srand
mt_getrandmax
number_format
OctDec
pi
pow
rad2deg
rand
round
Sin
sinh
Sqrt
srand
Tan
tanh

6.50.12 Ceil

[ Exemples avec Ceil ]  

Description

float ceil(float number )

ceil retourne l'entier supérieur du nombre number. Utiliser ceil sur un entier ne sert à rien. La valeur retournée est un nombre à virgule flottante (float), car ces nombres peuvent être plus grands que les entiers.

<?php
  $x 
ceil(4.25);
//  ce qui donne $x=5
?>

NOTE: ceil sous PHP/FI 2 retournait un nombre à virgule flottante. Utilisez: $new = (float)ceil($number); pour retrouver le comportement traditionnel.

Voir aussi floor et round.


Chapitre précédentChapitre suivantAccueil nexen.net