[php-src] Issue #14140: Floating point bug in range operation on Apple Silicon hardware

From: Date: Sun, 05 May 2024 12:47:03 +0000
Subject: [php-src] Issue #14140: Floating point bug in range operation on Apple Silicon hardware
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-246858@lists.php.net to get a copy of this message
Issue: https://github.com/php/php-src/issues/14140 Author: judahnator ### Description The following code: ```php <?php print_r(range(-0.03, 0.03, 0.01)); ``` Resulted in this output: ``` Array ( [0] => -0.03 [1] => -0.02 [2] => -0.01 [3] => 1.7347234759768E-18 [4] => 0.01 [5] => 0.02 ) ``` But I expected this output instead: ``` Array ( [0] => -0.03 [1] => -0.02 [2] => -0.01 [3] => 0 [4] => 0.01 [5] => 0.02 [6] => 0.03 ) ``` I tested this on a few devices with my peers. Every x86 processor we tested worked as expected, but reliably got the erroneous result using different Apple M2 devices. ### PHP Version PHP 8.3.6 ### Operating System Sonoma 14.4.1

« previous php.bugs (#246858) next »