This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug math/18244] New: remquol(x, INFINITY, &quo) is wrong on x86_64


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]