php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #36065 is_infinite & is_finite
Submitted: 2006-01-18 12:02 UTC Modified: 2006-01-18 12:17 UTC
From: goth at spellforce dot ru Assigned:
Status: Not a bug Package: Math related
PHP Version: 5.1.2 OS: unix
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: goth at spellforce dot ru
New email:
PHP Version: OS:

 

 [2006-01-18 12:02 UTC] goth at spellforce dot ru
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"!


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-01-18 12:17 UTC] tony2001@php.net
Try to set error_reporting to E_ALL ?
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue Jul 01 19:01:37 2025 UTC