Re: Loss of precision in intval()

From: Date: Wed, 01 Aug 2007 18:04:42 +0000
Subject: Re: Loss of precision in intval()
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-260019@lists.php.net to get a copy of this message
On 8/1/07, tg-php@gryffyndevelopment.com <tg-php@gryffyndevelopment.com> wrote: > Probably return "7582" instead of "7581". > > = = = Original message = = = > > On 8/1/07, Mark Summers <mark@metacharge.com> wrote: > > This sort of thing really isn't helpful... > > > > <?php > > > > $a = 75.82 * 100; > > > > echo intval($a); > > > > ?> > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > What exactly were you expecting it to do? :) > > > > ___________________________________________________________ > Sent by ePrompter, the premier email notification software. > Free download at http://www.ePrompter.com. > > http://us.php.net/manual/en/function.intval.php#63627 erics:~ eric$ php -r 'var_dump(printf("%.13f", (75.82 * 100)));' 7581.9999999999991int(18)

« previous php.general (#260019) next »