note 118074 added to math.constants
| From: | md2perpe at gmail dot com | Date: | Tue, 29 Sep 2015 14:43:11 +0000 |
| Subject: | note 118074 added to math.constants | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-203875@lists.php.net to get a copy of this message | ||
I just learnt of INF today and found out that it can be used in comparisons:
echo 5000 < INF ? 'yes' : 'no'; // outputs 'yes'
echo INF < INF ? 'yes' : 'no'; // outputs 'no'
echo INF <= INF ? 'yes' : 'no'; // outputs 'yes'
echo INF == INF ? 'yes' : 'no'; // outputs 'yes'
You can also take its negative:
echo -INF < -5000 ? 'yes' : 'no'; // outputs 'yes'
Division by INF is allowed:
echo 1/INF; // outputs '0'
----
Server IP: 72.52.91.14
Probable Submitter: 83.140.140.170
----
Manual Page -- http://php.net/manual/en/math.constants.php
Edit -- https://master.php.net/note/edit/118074
Del: integrated -- https://master.php.net/note/delete/118074/integrated
Del: useless -- https://master.php.net/note/delete/118074/useless
Del: bad code -- https://master.php.net/note/delete/118074/bad+code
Del: spam -- https://master.php.net/note/delete/118074/spam
Del: non-english -- https://master.php.net/note/delete/118074/non-english
Del: in docs -- https://master.php.net/note/delete/118074/in+docs
Del: other reasons-- https://master.php.net/note/delete/118074
Reject -- https://master.php.net/note/reject/118074
Search -- https://master.php.net/manage/user-notes.php