[Issue 6725] core.time.dur should accept floating point
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Wed Jul 23 18:41:51 PDT 2014
https://issues.dlang.org/show_bug.cgi?id=6725
--- Comment #35 from Walter Bright <bugzilla at digitalmars.com> ---
(In reply to Vladimir Panteleev from comment #34)
> 200ms and 0.2s are the same thing,
> how can it be meaningful to sleep for 200ms but not for 0.2s?
0.2 cannot be represented exactly as a floating point value. Therefore,
rounding error starts creeping in if you start adding many 0.2 increments. At
the end, the books don't balance.
Roundoff errors must be handled by the user, not the core library, because the
core library cannot know what the user is doing with their FP calculations.
--
More information about the Digitalmars-d-bugs
mailing list