note 130612 added to class.divisionbyzeroerror
| From: | rmaslo@archa.cz | Date: | Fri, 16 Jan 2026 19:05:21 +0000 |
| Subject: | note 130612 added to class.divisionbyzeroerror | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-222501@lists.php.net to get a copy of this message | ||
Subject: Avoiding the exception while maintaining IEEE 754 behavior
If you want to avoid throwing a DivisionByZeroError exception and instead get INF, -INF, or NAN
(following IEEE 754 standards, similar to how JavaScript or C++ behave), use the fdiv() function
instead of the / operator
----
Server IP: 206.189.2.9
Probable Submitter: 178.17.2.163
----
Manual Page -- https://php.net/manual/en/class.divisionbyzeroerror.php
Edit -- https://main.php.net/note/edit/130612
Del: integrated -- https://main.php.net/note/delete/130612/integrated
Del: useless -- https://main.php.net/note/delete/130612/useless
Del: bad code -- https://main.php.net/note/delete/130612/bad+code
Del: spam -- https://main.php.net/note/delete/130612/spam
Del: non-english -- https://main.php.net/note/delete/130612/non-english
Del: in docs -- https://main.php.net/note/delete/130612/in+docs
Del: other reasons-- https://main.php.net/note/delete/130612
Reject -- https://main.php.net/note/reject/130612
Search -- https://main.php.net/manage/user-notes.php