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/22243] New: log2(0) and log10(0) are wrong in downward rounding without the svid compat wrapper


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

            Bug ID: 22243
           Summary: log2(0) and log10(0) are wrong in downward rounding
                    without the svid compat wrapper
           Product: glibc
           Version: 2.27
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: math
          Assignee: unassigned at sourceware dot org
          Reporter: nszabolcs at gmail dot com
  Target Milestone: ---

log2(0) and log10(0) return inf instead of -inf in downward rounding when the
svid wrapper is suppressed (static linking, new targets).

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

int main()
{
        fesetround(FE_DOWNWARD);
        double y1 = log2(0);
        double y2 = log10(0);
        fesetround(FE_TONEAREST);
        printf("%a\n", y1);
        printf("%a\n", y2);
}

prints

inf
inf

with static linking.

-- 
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]