Bug #70009 [NEW]: modulus operator error

From: Date: Tue, 07 Jul 2015 10:21:07 +0000
Subject: Bug #70009 [NEW]: modulus operator error
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-194168@lists.php.net to get a copy of this message
From: s7sunder at gmail dot com Operating system: LINUX UBUNTU 14.04 PHP version: 5.6.11RC1 Package: Unknown/Other Function Bug Type: Bug Bug description:modulus operator error Description: ------------ Why these 2 values are not returning the true var_dump((1.005*1000)%5==0); //boolean false var_dump((1.015*1000)%5==0); //boolean false Remaining values are correct. Test script: --------------- <?php //These 2 are not returning the expected results var_dump((1.005*1000)%5==0); //boolean false var_dump((1.015*1000)%5==0); //boolean false var_dump((1.005*1000)%5==0); //boolean false var_dump((1.010*1000)%5==0); //boolean true var_dump((1.015*1000)%5==0); //boolean false var_dump((1.020*1000)%5==0); //boolean true var_dump((1.025*1000)%5==0); //boolean true var_dump((1.030*1000)%5==0); //boolean true var_dump((1.035*1000)%5==0); //boolean true var_dump((1.035*1000)%5==0); //boolean true var_dump((1.040*1000)%5==0); //boolean true var_dump((1.045*1000)%5==0); //boolean true var_dump((1.050*1000)%5==0); //boolean true var_dump((1.055*1000)%5==0); //boolean true var_dump((1.060*1000)%5==0); //boolean true var_dump((1.065*1000)%5==0); //boolean true var_dump((1.070*1000)%5==0); //boolean true var_dump((1.075*1000)%5==0); //boolean true var_dump((1.080*1000)%5==0); //boolean true var_dump((1.085*1000)%5==0); //boolean true var_dump((1.090*1000)%5==0); //boolean true var_dump((1.095*1000)%5==0); //boolean true var_dump((1.100*1000)%5==0); //boolean true -- Edit bug report at https://bugs.php.net/bug.php?id=70009&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=70009&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=70009&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=70009&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=70009&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=70009&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=70009&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=70009&r=needscript Try newer version: https://bugs.php.net/fix.php?id=70009&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=70009&r=support Expected behavior: https://bugs.php.net/fix.php?id=70009&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=70009&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=70009&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=70009&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=70009&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=70009&r=dst IIS Stability: https://bugs.php.net/fix.php?id=70009&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=70009&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=70009&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=70009&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=70009&r=mysqlcfg

« previous php.bugs (#194168) next »