php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #73923 Different floating point results with on modern machines (-ffp-contract)
Submitted: 2017-01-12 20:38 UTC Modified: 2022-05-20 14:04 UTC
From: christophm30 at gmail dot com Assigned:
Status: Wont fix Package: Date/time related
PHP Version: Irrelevant OS: all
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: christophm30 at gmail dot com
New email:
PHP Version: OS:

 

 [2017-01-12 20:38 UTC] christophm30 at gmail dot com
Description:
------------
As described in https://github.com/facebook/hhvm/issues/7594
there are new FMA (floating-point multiply-add) instructions,
which are emitted when the target system supports them
(GCC needs -O2 or higher).
The advantage of those instructions is that the provide more accurate results,
but that also means different results.

In HHVM this resulted in a self-test to fail.
As the calculated (and unexpected) value could be reproduced with
PHP7 on an arm64 machine (Ubuntu Xenial) as well,
I want to bring this up here in the PHP bugtracker as well.



Test script:
---------------
From https://github.com/facebook/hhvm/blob/master/hphp/test/slow/ext_date/date_sunrise_test.php:

date_default_timezone_set("Asia/Calcutta");
var_dump( date_sunrise(mktime(0, 0, 0, 12, 26, 2012), SUNFUNCS_RET_DOUBLE) );

We got 9.6226631046689 instead of 9.622663104669.


Patches

Add a Patch

Pull Requests

Pull requests:

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-04-01 19:45 UTC] tpunt@php.net
-Package: date_time +Package: Date/time related
 [2021-06-17 02:39 UTC] Ramdolph23 at gmail dot com
The following pull request has been associated:

Patch Name: Changes to doc-base for error page refactoring
On GitHub:  https://github.com/php/doc-base/pull/13
Patch:      https://github.com/php/doc-base/pull/13.patch
 [2022-05-20 14:04 UTC] derick@php.net
-Status: Open +Status: Wont fix
 [2022-05-20 14:04 UTC] derick@php.net
Thanks for letting us know, but this is not really an issue for the time of sun rise, as this is so sub-second that nobody will ever notice. If you still care about this, please open a new ticket at https://github.com/php/php-src
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 22:01:26 2024 UTC