[Libreoffice-bugs] [Bug 125580] Wrong value when adding two dates
bugzilla-daemon at bugs.documentfoundation.org
bugzilla-daemon at bugs.documentfoundation.org
Thu Apr 15 20:18:32 UTC 2021
https://bugs.documentfoundation.org/show_bug.cgi?id=125580
--- Comment #16 from b. <newbie-02 at gmx.de> ---
i have experimented a bit more, and found that: ... even if you get 'exact'
time values for the 5 minute intervals with tricky integer calculations, about
half of them suffer 'round down' if their bitstring is truncated before a zero
when added to the daily value, e.g.
~0001110001110 | 00111000 -> ~0001110001110, and the others 'round up' because
of the beginning of the truncated part being '1', e.g.
~0101010101010 | 10101010 -> ~010101010101*1*,
the rounded up values are 'big enough' to bring the correct result, the rounded
down values are not, the 'wall-clock-standard' makes 'just below' -> 59:59 ...?
a very very small 'protection-add' against such cases (of 1.9E-12, ~0.5 ULP in
the range?) which is not harmful in the result but mixes with the
'fp-artefacts', is sufficient to save such cases ...
maybe you should think about rounding times differently, IEEE 754 provides
roundup? or add a small protection-add if the result is in danger to be
interpreted as time value according to wall clock standard ...
happy hacking ...
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20210415/71915d39/attachment.htm>
More information about the Libreoffice-bugs
mailing list