public inbox for glibc-bugs@sourceware.org help / color / mirror / Atom feed
From: "newbie-02 at gmx dot de" <sourceware-bugzilla@sourceware.org> To: glibc-bugs@sourceware.org Subject: [Bug math/28472] pow(10, i) accuracy Date: Fri, 23 Sep 2022 16:33:03 +0000 [thread overview] Message-ID: <bug-28472-131-1FmvRU0eVn@http.sourceware.org/bugzilla/> (raw) In-Reply-To: <bug-28472-131@http.sourceware.org/bugzilla/> https://sourceware.org/bugzilla/show_bug.cgi?id=28472 --- Comment #8 from b. <newbie-02 at gmx dot de> --- are the following differences based on any reasonable idea? is it of help to dig down this issue? printf( "%.25E\n", pow( 10, 23 ) ); -> 9.9999999999999991611392000E+22 in contrast to: int j = 23; printf( "%.25E\n", pow( 10, j ) ); -> 1.0000000000000000838860800E+23 IMHO the results should match! same with 210: printf( "%.25E\n", pow( 10, 210 ) ); -> 9.9999999999999992711378242E+209 while: j = 210; printf( "%.25E\n", pow( 10, j ) ); -> 1.0000000000000000731118822E+210 seems independent of j defined as integer or double, and constants written as 'x' or 'x.0', but dependent on compiler options: no '-Ox' option set or '-O0': above differences, '-O1', '-O2' or '-O3' set : results match, all 9.99999xxx, different evaluation at compile- vs. runtime? I seem to remember similar oddities when a compiler replaces long double constants with doubles at compile time???? but why here? me in error? me stupid, me blackout? or is gcc / glibc / ??? kidding with the programmers? admit to be confused, esp. about this error being dependent on compiler options, while the test program by M Welinder, and gnumeric where the problem first came up, are not. -- You are receiving this mail because: You are on the CC list for the bug.
next prev parent reply other threads:[~2022-09-23 16:33 UTC|newest] Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-10-18 23:54 [Bug math/28472] New: " mwelinder at gmail dot com 2021-10-19 15:44 ` [Bug math/28472] " joseph at codesourcery dot com 2021-10-19 21:28 ` mwelinder at gmail dot com 2021-10-19 21:42 ` joseph at codesourcery dot com 2021-10-25 8:44 ` newbie-02 at gmx dot de 2021-11-14 5:38 ` newbie-02 at gmx dot de 2022-01-24 21:45 ` mwelinder at gmail dot com 2022-01-24 21:56 ` joseph at codesourcery dot com 2022-09-23 16:33 ` newbie-02 at gmx dot de [this message] 2023-01-09 14:43 ` newbie-02 at gmx dot de 2023-01-09 18:35 ` joseph at codesourcery dot com 2023-01-09 21:23 ` newbie-02 at gmx dot de 2023-01-09 21:36 ` joseph at codesourcery dot com 2023-01-10 0:23 ` newbie-02 at gmx dot de 2024-03-02 22:53 ` vincent-srcware at vinc17 dot net 2024-03-04 14:58 ` wdijkstr at arm dot com 2024-03-04 15:35 ` vincent-srcware at vinc17 dot net 2024-03-04 16:07 ` wdijkstr at arm dot com 2024-03-04 17:09 ` vincent-srcware at vinc17 dot net 2024-03-04 18:27 ` wdijkstr at arm dot com 2024-03-04 19:23 ` vincent-srcware at vinc17 dot net 2024-03-18 21:09 ` newbie-02 at gmx dot de 2024-03-18 22:17 ` wdijkstr at arm dot com 2024-03-20 9:02 ` newbie-02 at gmx dot de 2024-03-20 9:56 ` vincent-srcware at vinc17 dot net 2024-03-20 13:54 ` wdijkstr at arm dot com
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-28472-131-1FmvRU0eVn@http.sourceware.org/bugzilla/ \ --to=sourceware-bugzilla@sourceware.org \ --cc=glibc-bugs@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).