PHP

�������������� �������

������� ����������

Rambler's Top100
abs
���������� ������ �����.

��������� :
mixed abs(mixed $number)

��� ��������� $number ����� ���� float ��� int, � �� � ������������� �������� ������ ��������� � ����� ����� ���������.
$x = abs(-4);    // $x=4
$x = abs(-7.45); // $x=7.45

round
���������� �������� ����� �� ������.

��������� :
double round(double $val)

��������� $val �� ���������� ������ � ���������� ���������.
$foo = round(3.4); // $foo == 3.0
$foo = round(3.5); // $foo == 4.0
$foo = round(3.6); // $foo == 4.0
$x = round(5.3);  // $x=5
$x = round(5.4);  // $x=5
$x = round(5.45); // $x=5
$x = round(5.5);  // $x=6

ceil
���������� �������� ����� �� ���������� ������.

��������� :
int ceil(float $number)

���������� ���������� ����� �����, �� ������ $number. ����������, ���������� � $number ����� ����� ������������.
$x = ceil(5.0);  // $x=5
$x = ceil(5.1);  // $x=6
$x = ceil(5.9);  // $x=6

floor
�������� ������� ����� �����.

��������� :
int floor(float $number)

���������� ������������ ����� �����, �� ������������� $number.
$x = floor(5.1);  // $x=5
$x = floor(5.9);  // $x=5
�� ���������� ����� ����� ������� "PHP 4. ����������� ����������."
www.piter.com
��������� � ����� "���������� Web-������": www.spravkaweb.ru.

Rambler's Top100