This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug math/17569] remquo returns the wrong quotient
- From: "charles at karney dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Sun, 09 Nov 2014 15:02:49 +0000
- Subject: [Bug math/17569] remquo returns the wrong quotient
- Auto-submitted: auto-generated
- References: <bug-17569-131 at http dot sourceware dot org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=17569
--- Comment #1 from charles at karney dot com <charles at karney dot com> ---
(Sorry about the premature submission of the bug report. Perhaps "enter"
shouldn't do a submit...)
Compiling and running the following code
int main() {
int n;
double x = 3419, m = 360;
double y = __builtin_remainder(x, m);
double z = __builtin_remquo(x, m, &n);
__builtin_printf("result %.0f %.0f %d\n", y, z, n);
}
with
gcc -O0 -o remquo-bug remquo-bug.c -lm && ./remquo-bug
gives (second number is wrong)
result 179 539 8
On the other hand
gcc -O1 -o remquo-bug remquo-bug.c -lm && ./remquo-bug
gives the correct result
result 179 179 9
--
You are receiving this mail because:
You are on the CC list for the bug.