Doc #80683 [Opn->Csd]: Untrue statement about microtime() precision
| From: | php4fan at gmail dot com | Date: | Thu, 28 Jan 2021 19:08:39 +0000 |
| Subject: | Doc #80683 [Opn->Csd]: Untrue statement about microtime() precision | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-18463@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=80683&edit=1
ID: 80683
User updated by: php4fan at gmail dot com
Reported by: php4fan at gmail dot com
Summary: Untrue statement about microtime() precision
-Status: Open
+Status: Closed
Type: Documentation Problem
Package: Documentation problem
Operating System: linux
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
Whops, sorry, not true, I was just printing it and it got rounded when converted to string.
Previous Comments:
------------------------------------------------------------------------
[2021-01-28 19:03:51] php4fan at gmail dot com
Description:
------------
---
From manual page: https://php.net/function.microtime
---
It states:
"If as_float is set to true, then microtime() returns a float, which represents the current
time in seconds since the Unix epoch accurate to the nearest microsecond."
That's not true. The value returned as float is not accurate to the nearest microsecond. Now I
guess that's obvious if you know what the precision of a float is, but if I read a sentence
that says "accurate to the nearest microsecond", I'm not going to do maths, I'll
assume that who wrote the sentence already did that for me, so if they say "accurate to the
nearest microsecond" I'll assume they figured out that the typical precision of a float is
enough to give you a 1-microsecond precision on such a number.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=80683&edit=1