public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug math/18244] New: remquol(x, INFINITY, &quo) is wrong on x86_64
@ 2015-04-10 12:20 nszabolcs at gmail dot com
  2015-05-19 23:45 ` [Bug math/18244] " cvs-commit at gcc dot gnu.org
  2015-05-19 23:46 ` jsm28 at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: nszabolcs at gmail dot com @ 2015-04-10 12:20 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=18244

            Bug ID: 18244
           Summary: remquol(x, INFINITY, &quo) is wrong on x86_64
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: math
          Assignee: unassigned at sourceware dot org
          Reporter: nszabolcs at gmail dot com

remquol(x, INFINITY, &quo) should return x (that's the remainder)

the following code on linux x86_64 prints:
remquol(42,inf) = -nan  quo = 0  invalid=1
remquol(42,-inf) = -nan  quo = 0  invalid=1


#include <fenv.h>
#include <math.h>
#include <stdio.h>

int main()
{
#pragma STDC FENV_ACCESS ON
int quo;
long double r;

feclearexcept(FE_ALL_EXCEPT);
r = remquol(42, INFINITY, &quo);
if (r != 42)
        printf("remquol(42,inf) = %La  quo = %d  invalid=%d\n", r, quo,
fetestexcept(FE_INVALID));

feclearexcept(FE_ALL_EXCEPT);
r = remquol(42, -INFINITY, &quo);
if (r != 42)
        printf("remquol(42,-inf) = %La  quo = %d  invalid=%d\n", r, quo,
fetestexcept(FE_INVALID));
}

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-05-19 23:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-10 12:20 [Bug math/18244] New: remquol(x, INFINITY, &quo) is wrong on x86_64 nszabolcs at gmail dot com
2015-05-19 23:45 ` [Bug math/18244] " cvs-commit at gcc dot gnu.org
2015-05-19 23:46 ` jsm28 at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).