Re: Round

From: Date: Wed, 29 Aug 2007 17:59:17 +0000
Subject: Re: Round
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-261471@lists.php.net to get a copy of this message
I'm running 5.2.3. Reaction on above discussion: of course this problem can be solved with all sorts of solutions, but my question is: is it good that a function returns a number that doesn't exist? I once posted a bug report about a wrong round()-result, though it wasn't a bug, but a consequence of the limited precision of PHP when using floats. So I'm just checking, before shouting out loud that there's something wrong. So, again: my question is not how to solve this, but whether or not this is expected behaviour. "Jim Lucas" <lists@cmsws.com> wrote in message news:46D5986D.8000703@cmsws.com... > Koen van den Boogaart wrote: >> Is it expected behaviour that >> >> <?php var_dump( round(-0.26) ); ?> >> >> outputs >> >> float(-0) > What version of PHP are you running. > > I'm running 5.1.6 and I get float(0) > > -- > Jim Lucas > > "Some men are born to greatness, some achieve greatness, > and some have greatness thrust upon them." > > Twelfth Night, Act II, Scene V > by William Shakespeare

« previous php.general (#261471) next »