Date: Wed, 08 May 2019 16:53:46 +0000 From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 237800] pow(3) returns inaccurate results Message-ID: <bug-237800-227@https.bugs.freebsd.org/bugzilla/>
next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D237800 Bug ID: 237800 Summary: pow(3) returns inaccurate results Product: Base System Version: CURRENT Hardware: Any OS: Any Status: New Severity: Affects Many People Priority: --- Component: misc Assignee: bugs@FreeBSD.org Reporter: khw@cpan.org Attachment #204271 text/plain mime type: Created attachment 204271 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D204271&action= =3Dedit Reproducer .c The attached essentially one-liner, program prints 0x1.431e0fae6d722p+96 on FreeBSD 13 clang version 8.0.0 (tags/RELEASE_800/final 356365) (based on LLVM 8.0.0) On Linux, it prints 0x1.431e0fae6d721p+96 a difference of 1 in the final hex digit of the mantissa. The Linux versio= n is the correct value. We are getting identical failures on 11.2, 12.0, and Open BSD 6.4 http://www.cpantesters.org/distro/M/Math-Clipper.html?grade=3D3&perlmat=3D1= &patches=3D2&oncpan=3D2&distmat=3D2&perlver=3DALL&osname=3DALL&version=3D1.= 27 I work on maintaining and extending the Perl 5 programming language. We ma= de a change earlier in our current development cycle that improved the accuracy = of converting a string representing a floating point number into an equivalent double precision C value. We now use strtod() instead of atof(). That bro= ke the module Math::Clipper. It turns out it was relying on the imprecision of atof() to work around this pow() bug. That work around was added in May 20= 18. The above smoke reports rely on a volunteer network of people to do the testing. That means the coverage of a module such as Math::Clipper is spot= ty.=20 Probably it's failing Open BSD in other versions of Perl, but those just di= dn't get tested. --=20 You are receiving this mail because: You are the assignee for the bug.=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-237800-227>