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 19:53:30 +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 #10 from Robert Dodier <robert.dodier at gmail dot com> ---
(In reply to Andreas Schwab from comment #7)
> remainder(8, 1.6) returns -4.4e-16, thus, per definitionem, fmod(8, 1.6)
> returns remainder(8, 1.6) + 1.6 = 1.5999999999999996447.
Andreas, I'm not sure why you're bringing 'remainder' into the picture, as
description of fmod in the glibc documentation [1] is that "the return value is
numerator - n * denominator, where n is the quotient of numerator divided by
denominator, rounded towards zero to an integer."
Incidentally the description of floor [2] is that it is supposed to "round x
downwards to the nearest integer". That seems to suggest that
floor(numerator/denominator) is the same as n in the description of fmod.
[1] http://www.gnu.org/software/libc/manual/html_node/Remainder-Functions.html
[2] http://www.gnu.org/software/libc/manual/html_node/Rounding-Functions.html
--
You are receiving this mail because:
You are on the CC list for the bug.