Bug #73923 [PATCH]: Different floating point results with on modern machines (-ffp-contract)

From: Date: Thu, 17 Jun 2021 02:39:31 +0000
Subject: Bug #73923 [PATCH]: Different floating point results with on modern machines (-ffp-contract)
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-234440@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=73923&edit=1 ID: 73923 Patch added by: Ramdolph23@gmail.com Reported by: christophm30 at gmail dot com Summary: Different floating point results with on modern machines (-ffp-contract) Status: Open Type: Bug Package: Date/time related Operating System: all PHP Version: Irrelevant Block user comment: N Private report: N New Comment: 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 Previous Comments: ------------------------------------------------------------------------ [2017-01-12 20:38:25] 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. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=73923&edit=1

« previous php.bugs (#234440) next »