On Wed, 09 Feb 2011 20:54:41 +0100, Christian Sciberras said: > $f=floatval("2.2250738585072011e-308"); > echo 'Try 2 => '.$f.'</br>'; > Plus, I'm a bit amazed such a bug exists in PHP - since converting to > floating point is a trivial operation, it should have been limited and > safe-guarded from the start. Take a careful gander at that number, then go look at the floating point spec - it's a specific corner case that isn't obviously trivial to get right (doing floating point *right* is a lot harder than it looks - take a class on numerical methods sometime, you spend 75% of your time dealing with rounding errors in the last bit). Having said that, anybody writing floating point support for a package should probably google 'floating point paranoia' and learn what sort of things to test for. :)
Attachment:
pgpz7p_q40T83.pgp
Description: PGP signature
_______________________________________________ Full-Disclosure - We believe in it. Charter: http://lists.grok.org.uk/full-disclosure-charter.html Hosted and sponsored by Secunia - http://secunia.com/