note 77402 added to function.is-infinite
| From: | stangelanda at arrowquick dot com | Date: | Tue, 28 Aug 2007 14:28:59 +0000 |
| Subject: | note 77402 added to function.is-infinite | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-129852@lists.php.net to get a copy of this message | ||
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.
----
Server IP: 208.69.120.35
Probable Submitter: 216.248.100.66
----
Manual Page -- http://www.php.net/manual/en/function.is-infinite.php
Edit -- https://master.php.net/note/edit/77402
Del: integrated -- https://master.php.net/note/delete/77402/integrated
Del: useless -- https://master.php.net/note/delete/77402/useless
Del: bad code -- https://master.php.net/note/delete/77402/bad+code
Del: spam -- https://master.php.net/note/delete/77402/spam
Del: non-english -- https://master.php.net/note/delete/77402/non-english
Del: in docs -- https://master.php.net/note/delete/77402/in+docs
Del: other reasons-- https://master.php.net/note/delete/77402
Reject -- https://master.php.net/note/reject/77402
Search -- https://master.php.net/manage/user-notes.php