Bug #8961 Updated: Omited Math Function

From: Date: Sun, 09 Sep 2001 09:31:31 +0000
Subject: Bug #8961 Updated: Omited Math Function
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-65534@lists.php.net to get a copy of this message
ID: 8961 Updated by: sterling Reported By: Frank@kujawski.Org Old Status: Analyzed Status: Bogus Bug Type: Math related Operating System: N/A PHP Version: 4.0 Latest CVS (27/01/2001) New Comment: PHP is not to my knowledge ASP. This is won't (shouldn't) be added anytime soon... Previous Comments: ------------------------------------------------------------------------ [2001-01-27 20:55:06] rasmus@php.net Not sure what you are asking for here. round() exists Modulus exists with the modulus operator. ie. echo 3%2; ceil() exists floor() exists Division obviously exists Trunc sort of exists: echo (int)10.57; Frac can be derived as well. But I suppose that is the one you are asking for a native function for? ------------------------------------------------------------------------ [2001-01-27 20:46:50] Frank@kujawski.Org 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 this bug report at http://bugs.php.net/?id=8961&edit=1

« previous php.dev (#65534) next »