This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug math/19869] floor and fmod not consistent with each other
- From: "robert.dodier at gmail dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Tue, 29 Mar 2016 06:15:15 +0000
- Subject: [Bug math/19869] floor and fmod not consistent with each other
- Auto-submitted: auto-generated
- References: <bug-19869-131 at http dot sourceware dot org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=19869
--- Comment #5 from Robert Dodier <robert.dodier at gmail dot com> ---
(In reply to Florian Weimer from comment #4)
> I think this is just one of the cases where the specification of fmod does
> not uniquely determine the value to be returned. Both 0 and
> 1.5999999999999996 are valid because 8.0 - 4 * 1.6 = 1.5999999999999996 and
> 8.0 - 5 * 1.6 = 0.
Florian, thanks for taking the time to comment. It seems to follow from what
you're saying that the integer part of 8/1.6 might be either 4 or 5, and these
are equally valid. Doesn't it have to be one or the other?
Incidentally 8.0 - 5*1.6 is actually not 0.0 but rather something like -4e-16.
That value makes fmod consistent with floor but it doesn't fit the description
of fmod, that the return value should be the same sign as 1.6.
--
You are receiving this mail because:
You are on the CC list for the bug.