Re: Round

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 8/29/07, Richard Heyes <richardh@xxxxxxxxxxx> wrote:
> Koen van den Boogaart wrote:
> > No, I want it to go to float(0), so minus the minus. "-0" doesn't exist in
> > math, as far as I know. Probably a precision thing.
>
> Ok, then try abs() first then.
>
> --
> Richard Heyes
> +44 (0)844 801 1072
> http://www.websupportsolutions.co.uk
>
> Knowledge Base and HelpDesk software
> that can cut the cost of online support
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

    Richard (Heyes) is right.

    <?php echo var_dump(abs(round(-0.26)))."\n"; ?>

    Tested on 5.0.4 and 5.2.3.

-- 
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

Hey, PHP-General list....
50% off for life on web hosting plans $10/mo. or more at
http://www.pilotpig.net/.
Use the coupon code phpgeneralaug07
Register domains for about $0.01 more than what it costs me at
http://domains.pilotpig.net/.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux