note 111952 added to function.round

From: Date: Wed, 17 Apr 2013 08:03:34 +0000
Subject: note 111952 added to function.round
Groups: php.notes 
Request: Send a blank email to php-notes+get-194500@lists.php.net to get a copy of this message
For negative values the round function seems to be broken? I would expect that -2,5 round up to -2 what it does is it rounds down to -3. This one works like expected function jRound($x){ return floor($x + 0.5); } ---- Server IP: 69.147.83.199 Probable Submitter: 193.175.244.35 ---- Manual Page -- http://php.net/manual/en/function.round.php Edit -- https://master.php.net/note/edit/111952 Del: integrated -- https://master.php.net/note/delete/111952/integrated Del: useless -- https://master.php.net/note/delete/111952/useless Del: bad code -- https://master.php.net/note/delete/111952/bad+code Del: spam -- https://master.php.net/note/delete/111952/spam Del: non-english -- https://master.php.net/note/delete/111952/non-english Del: in docs -- https://master.php.net/note/delete/111952/in+docs Del: other reasons-- https://master.php.net/note/delete/111952 Reject -- https://master.php.net/note/reject/111952 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#194500) next »