Bug #51396 [Bgs]: Math is Unreliable

From: Date: Mon, 24 May 2010 12:14:55 +0000
Subject: Bug #51396 [Bgs]: Math is Unreliable
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-150763@lists.php.net to get a copy of this message
Edit report at http://bugs.php.net/bug.php?id=51396&edit=1

 ID:               51396
 Updated by:       pajoye@php.net
 Reported by:      codeslinger at compsalot dot com
 Summary:          Math is Unreliable
 Status:           Bogus
 Type:             Bug
 Package:          Math related
 Operating System: any
 PHP Version:      Irrelevant

 New Comment:

And please use latest 5.3 or 5.2, from our downloads (only).


Previous Comments:
------------------------------------------------------------------------
[2010-05-24 14:04:53] codeslinger at compsalot dot com

P.S.  Please note that in my own testing I have verified that the
presence or absence of the xdebug and zend debug extensions do not alter
the behavior of this bug, this was verified on Windows.

Also note how for instance 5.2.4 fails on Windows and on Ubuntu but
works on Mandriva  (or at least was not found to fail on Mandriva).

Also I can tell you from my own testing that the specific values which
fail on Windows are very different from the specific values which fail
on Unbuntu, when tested on the same computer.  The only thing which can
be said with some level of confidence is that all of the failures
involve numbers with the digit 9 in them.  Since these are 58? digit
numbers and only a very few specific values fail, the potential to NOT
see a failure is huge.

------------------------------------------------------------------------
[2010-05-24 13:59:45] pajoye@php.net

Please read my last comment and provide the info I asked there. Without
that, there is not a chance to get anywhere regarding this issue.

------------------------------------------------------------------------
[2010-05-24 13:46:10] codeslinger at compsalot dot com

In Summary:  As Reported by Multiple People

Windows XP (32 bit)  PHP 5.2.4  Fails
Windows XP (32 bit)  PHP 5.2.5  Works
Windows 2000 (32 bit)  PHP 5.2.5  Works
Windows XP (32 bit)  PHP 5.2.9  Fails
Windows 2000 (32 bit)  PHP 5.2.9  Fails
Windows 2000 (32 bit)  PHP 5.2.11 Fails
Windows 2003 (?? bit)  PHP 5.2.12 Fails
Windows 2003 (?? bit)  PHP 5.2.13 Fails

Ubuntu 8 (32bit)  PHP 5.2.4  Fails
Ubuntu 8 (32bit)  PHP 5.2.9 (custom build)  Works
Ubuntu 9 (64bit)  PHP 5.2.10  Works

Mandriva 2008 (32bit & 64bit)  PHP 5.2.4 Works
Mandriva 2008 (32bit & 64bit)  Unpatched PHP 5.2.5 Fails

This bug has been reported by multiple people.  The above list is the
combination of my own testing plus what I found reported by other
people.  The windows oses are all using the STOCK BUILD as provided by
php.net


It is very important to understand that the specific values which fail
are highly variable.  A specific value which fails on one os/php version
does not necessarily fail on a different combination of os+php, but a
different value will fail instead.

It is also important to realize that given the obscurity and variability
of this bug, just because a particular version of php is reported as
working, does not guarantee that the bug does not exist, it only says
that so far no one has reported encountering a specific value which
triggers this bug.

All of the following are thought to influence the specific behavior and
reproducibility of this bug.

The number of cpu bits
The operating system
The specific version of php
The compiler flags that were used to build php
The "precision" setting for php
The format specifier/precision in an sprintf statement
sprintf versus implied (string) conversion

It is also possible that the floating point hardware could have an
influence on the reproducibility of this bug.

Since the WORK-AROUND did not work for John, it would appear that we
still have a problem which needs to be solved.

------------------------------------------------------------------------
[2010-05-24 03:17:36] john dot smith dot 1964 at gmail dot com

This problem isn't fixed for us by adding "ini_set("precision", 16);".
Our PHP 
install is stock off the website (5.2.4 and 5.2.13, for instance) and
our box runs 
Windows 2003.

------------------------------------------------------------------------
[2010-05-24 02:18:46] pajoye@php.net

.

------------------------------------------------------------------------


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    http://bugs.php.net/bug.php?id=51396


-- 
Edit this bug report at http://bugs.php.net/bug.php?id=51396&edit=1


Thread (39 messages)

« previous php.bugs (#150763) next »