Re: pow() vs. float when doing match.

From: Date: Wed, 24 Apr 2002 16:02:41 +0000
Subject: Re: pow() vs. float when doing match.
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-94404@lists.php.net to get a copy of this message
Scott Fletcher <scott@abcoa.com> wrote: > There is the calculation errors for the floating point, so I checked the > PHP website. On that website, the function webpage, pow(). It said that > "In PHP 4.0.6 and earlier pow() always returned a float, and did not issue > warnings.". So, there was some changes to the pow() on PHP 4.0.7 and after. > Let's do the demo script. > > echo pow(0, 0.0829); > > It should return a "0" as it did in version 4.0.6 and before. But > version 4.0.7 and after, it returned a "-1.#IND". Why is that? What is the > other way around to fix the problem? Let me know! pow() was badly broken in the 4.1.x series, particularly in the various edge conditions (like using 0 for either argument). 4.2.0 gets it right. jim

« previous php.general (#94404) next »