note 77403 added to function.is-infinite

From: Date: Tue, 28 Aug 2007 14:29:05 +0000
Subject: note 77403 added to function.is-infinite
Groups: php.notes 
Request: Send a blank email to php-notes+get-129853@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/77403 Del: integrated -- https://master.php.net/note/delete/77403/integrated Del: useless -- https://master.php.net/note/delete/77403/useless Del: bad code -- https://master.php.net/note/delete/77403/bad+code Del: spam -- https://master.php.net/note/delete/77403/spam Del: non-english -- https://master.php.net/note/delete/77403/non-english Del: in docs -- https://master.php.net/note/delete/77403/in+docs Del: other reasons-- https://master.php.net/note/delete/77403 Reject -- https://master.php.net/note/reject/77403 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#129853) next »