Bug #75098 [Opn->Nab]: Unexpected output

From: Date: Sun, 20 Aug 2017 07:49:06 +0000
Subject: Bug #75098 [Opn->Nab]: Unexpected output
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-210751@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=75098&edit=1 ID: 75098 Updated by: requinix@php.net Reported by: coolbalyan at gmail dot com Summary: Unexpected output -Status: Open +Status: Not a bug Type: Bug Package: *General Issues Operating System: window PHP Version: 7.1.8 Block user comment: N Private report: N New Comment: Floating point values have a limited precision. Hence a value might not have the same string representation after any processing. That also includes writing a floating point value in your script and directly printing it without any mathematical operations. If you would like to know more about "floats" and what IEEE 754 is, read this: http://www.floating-point-gui.de/ Thank you for your interest in PHP. > it looks like it taking near around 9-10 seconds. https://en.wikipedia.org/wiki/Scientific_notation#E-notation Previous Comments: ------------------------------------------------------------------------ [2017-08-20 07:31:26] coolbalyan at gmail dot com Description: ------------ When script subtract value from two "microtime", it produce value in unexpected way. script take almost a fraction on second but substraction of value from taken from "microtime" make it incremented. it looks like it taking near around 9-10 seconds. Test script: --------------- $time_start=microtime(TRUE); /****Performance Check****/ $time_end=microtime(TRUE); var_dump(PHP_VERSION, $time_end-$time_start); Expected result: ---------------- 0 Actual result: -------------- 9.5367431640625E-7 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=75098&edit=1

« previous php.bugs (#210751) next »