bcceil

(PHP 8 >= 8.4.0)

bcceil β€” Round up arbitrary precision number

Опис

bcceil(string $num): string

Returns the next highest integer value by rounding up num if necessary.

ΠŸΠ°Ρ€Π°ΠΌΠ΅Ρ‚Ρ€ΠΈ

num
The value to round.

ЗначСння, Ρ‰ΠΎ ΠΏΠΎΠ²Π΅Ρ€Ρ‚Π°ΡŽΡ‚ΡŒΡΡ

Returns a numeric string representing num rounded up to the nearest integer.

Помилки/Π²ΠΈΠΊΠ»ΡŽΡ‡Π΅Π½Π½Ρ

This function throws a ValueError if num is not a well-formed BCMath numeric string.

ΠŸΡ€ΠΈΠΊΠ»Π°Π΄ΠΈ

ΠŸΡ€ΠΈΠΊΠ»Π°Π΄ #1 bcceil() example

<?php
var_dump
(bcceil('4.3'));
var_dump(bcceil('9.999'));
var_dump(bcceil('-3.14'));
?>

Поданий Π²ΠΈΡ‰Π΅ ΠΏΡ€ΠΈΠΊΠ»Π°Π΄ Π²ΠΈΠ²Π΅Π΄Π΅:

string(1) "5"
string(2) "10"
string(2) "-3"

ΠŸΡ€ΠΎΠ³Π»ΡΠ½ΡŒΡ‚Π΅ Ρ‚Π°ΠΊΠΎΠΆ

  • bcfloor() - Round down arbitrary precision number
  • bcround() - Round arbitrary precision number
  • BcMath\Number::ceil()
οΌ‹add a note

User Contributed Notes

There are no user contributed notes for this page.