PHP 4.0 Bug #8961: Omited Math Function
| From: | Frank at kujawski dot Org | Date: | Sun, 28 Jan 2001 01:46:50 +0000 |
| Subject: | PHP 4.0 Bug #8961: Omited Math Function | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-45173@lists.php.net to get a copy of this message | ||
From: Frank@kujawski.Org
Operating system: N/A
PHP version: 4.0 Latest CVS (27/01/2001)
PHP Bug Type: Math related
Bug description: Omited Math Function
There are a set of four math function that convert real numbers to integers, trunc is missing.
Other functions of use are Frac, Mod, Div.
Round: return closest integer to argument, if fractional is .5 then return closest even integer.
Ceiling: return smallest integer greater than or equal to argument
Floor: return largest integer less than or equal to argument
Trunc: if argument is positive, return floor of argument, otherwise return ceiling of argument.
Frac: return abs(argument - trunc(argument))
Mod: returns remainder of the division of two arguments
Div: returns quotiant of the division of two arguments
(I ran into this problem when converting a decimal number to an IP number.)
--
Edit Bug report at: http://bugs.php.net/?id=8961&edit=1