Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Fri, 4 Apr 2014 09:32:18 -0400
From: Morten Welinder <mwelinder@...il.com>
To: musl@...ts.openwall.com
Subject: printf issues

I am seeing differences in how printf("%.200Lg",val) works between musl code
and glibc.

Here are some samples.  The top line is how musl prints, the bottom is glibc.

-65878995336522048.000000000
-65878995336522048

1954675876964773.500000000
1954675876964773.5

3953605802361882.000000000
3953605802361882


Unrelatedly, from function fmt_fp:

#define CONCAT2(x,y) x ## y
#define CONCAT(x,y) CONCAT2(x,y)
[...]
            long double round = CONCAT(0x1p,LDBL_MANT_DIG);

That code is cute as a Hello Kitty door knocker, but really?  Let's hope nobody
gets the urge to define LDBL_MANT_DIG as 0100 or (80-16) or some such.
The first case will still compile, but get the wrong result.

Morten

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.