Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140405025010.GA3774@brightrain.aerifal.cx>
Date: Fri, 4 Apr 2014 22:50:10 -0400
From: Rich Felker <dalias@...ifal.cx>
To: musl@...ts.openwall.com
Subject: Re: printf issues

On Fri, Apr 04, 2014 at 10:08:47PM -0400, Morten Welinder wrote:
> > [...] excess precision (FLT_EVAL_METHOD==2). This is why
> > musl uses long double internally everywhere that rounding semantics
> > matter.
> 
> That's what I thought, but it's not actually what I see over in src/math/.

I guess I should elaborate that I meant everywhere in the code that I
wrote, which doesn't include anything in src/math except asm.

> If I look in src/math/floor.c I see an explicit cast from double to double
> used to get rid of excess precision.  The similar thing ought to work in
> fmt_fp.

Yes, I think this works, but it's fairly fragile under the possibility
of compiler bugs. FWIW, floor, etc. all have asm versions on i386 so
the excess precision issue doesn't come into play unless you go out of
your way to remove the asm. (This reminds me -- I want to eventually
separate mandatory asm from optimization asm, to make it easier to
test C code that would otherwise be shadowed by asm.)

Rich

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.