Round()

Syntaxe

Resultat.f = Round(Nombre.f, Mode)
Description
Arrondi le nombre flottant spécifié selon le mode choisi. 'Mode' peut prendre l'une des valeurs suivantes :
  #PB_Round_Down   : le nombre est arrondi par défaut. 
  #PB_Round_Up     : le nombre est arrondi par excès.
  #PB_Round_Nearest: le nombre est arrondi à l'entier le plus proche (0.5 est arrondi à 1)

Exemple

  Debug Round(11.6, #PB_Round_Down)    ; Affichera '11'
  Debug Round(-3.6, #PB_Round_Down)    ; Affichera '-4'

  Debug Round(11.6, #PB_Round_Up)      ; Affichera '12'
  Debug Round(-1.6, #PB_Round_Up)      ; Affichera '-1'

  Debug Round(11.6, #PB_Round_Nearest) ; Affichera '12'
  Debug Round(11.4, #PB_Round_Nearest) ; Affichera '11'
  Debug Round(11.5, #PB_Round_Nearest) ; Affichera '12'
  Debug Round(-7.5, #PB_Round_Nearest) ; Affichera '-8'

OS Supportés

Tous

<- Radian() - Math Index - Sign() ->