This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
Re: [Ask for help]: Met a problem with strtof
- From: Mark Brown <ms_brown at sbcglobal dot net>
- To: Wang Weidong <wangweidong1 at huawei dot com>
- Cc: libc-help at sourceware dot org
- Date: Fri, 25 Apr 2014 09:18:49 -0500
- Subject: Re: [Ask for help]: Met a problem with strtof
- Authentication-results: sourceware.org; auth=none
- References: <53566C6A dot 4050804 at huawei dot com> <5358058F dot 9010806 at sbcglobal dot net> <5358691A dot 1090104 at huawei dot com> <53598073 dot 9010809 at sbcglobal dot net> <535A100A dot 409 at huawei dot com>
On 04/25/2014 02:34 AM, Wang Weidong wrote:
> I found a Bug report on https://sourceware.org/bugzilla/show_bug.cgi?id=14518
> which report "strtod ignores the rounding mode and always tries to round to nearest. "
> Such as FE_UPWARD is "rounding towards positive infinity"
> It means that the value should "<=" the rounding value.
> So I think in glibc-2.11 here "-0x1.4EF009P-16 -> -0x1.4ef00ap-16" it is wrong while
> in glibc-2.17+ is right. And similar to the others.
Well, as I noted when I started this I'm not an FP expert; but the glibc
2.19 results I get match my expectations.
--
Mark Brown
ms_brown@sbcglobal.net