note 77402 deleted from function.is-infinite by nlopess

From: Date: Sat, 01 Sep 2007 12:16:35 +0000
Subject: note 77402 deleted from function.is-infinite by nlopess
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-130028@lists.php.net to get a copy of this message
Note Submitter: stangelanda at arrowquick dot com ---- Actually any string ending in INF is more appropriate than any string beginning with INF. Since negative infinity evaluates to "-INF" but it is still infinite. However in either case the STRING "INF" is not infinite, only a float that converts to "INF" or "-INF" is infinite. A more appropriate function might be: <?php if (!is_defined('is_infinite')) { function is_infinite($val) { return (is_float($val) and ("$val"=='INF' or "$val"=='-INF')); } } ?> * However the above function is untested.

« previous php.notes (#130028) next »