|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-01-18 12:17 UTC] tony2001@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Dec 14 04:00:01 2025 UTC |
Description: ------------ Hello, I've incountered a following mistake in your is_infinite function - why does it return 'false' in the following example? Here is_infinite returns 'false' and is_finite - convercely, 'true'. Reproduce code: --------------- <?PHP $T1=1; $T2=0; if (is_infinite($T1/$T2)) { $R="value is infinite"; // 1) } else { $R="value is finite"; // 2) } echo $R; ?> So this script outputs 2) instead of 1), but it's incorrect Expected result: ---------------- From the maths. analisys follows, that constant / zero = infinity So the answer must be "value is infinite" not ="value is finite"!