From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 570793858009; Fri, 23 Sep 2022 16:33:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 570793858009 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1663950785; bh=Kr2Bo3c3DvlavP/8hOxQN9xIRikLQQLXfFl5ODvFfYE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=HJD/UkejRL7WcHvaXgPWrAn6+E+jJFjTSFlfuPeBmLsgzC1lg02dSa9H5M+heoekv LdiFi+MHZxBDoiPP2kQ1EYR+MipJAGT4m9KvgC059T0UMeuNTOisok33ocLr3HWKSE irF8QRnf4kMkNLdUTO7moNpVyQ+1RqaiyISkzvAw= From: "newbie-02 at gmx dot de" To: glibc-bugs@sourceware.org Subject: [Bug math/28472] pow(10, i) accuracy Date: Fri, 23 Sep 2022 16:33:03 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: math X-Bugzilla-Version: 2.31 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: newbie-02 at gmx dot de X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D28472 --- Comment #8 from b. --- are the following differences based on any reasonable idea? is it of help to dig down this issue?=20=20 printf( "%.25E\n", pow( 10, 23 ) ); -> 9.9999999999999991611392000E+22=20= =20 in contrast to:=20=20 int j =3D 23;=20=20 printf( "%.25E\n", pow( 10, j ) ); -> 1.0000000000000000838860800E+23=20= =20 IMHO the results should match!=20=20 same with 210:=20=20 printf( "%.25E\n", pow( 10, 210 ) ); -> 9.9999999999999992711378242E+209=20= =20 while:=20=20 j =3D 210;=20=20 printf( "%.25E\n", pow( 10, j ) ); -> 1.0000000000000000731118822E+210=20= =20 seems independent of j defined as integer or double, and constants written = as 'x' or 'x.0', but dependent on compiler options:=20=20 no '-Ox' option set or '-O0': above differences,=20=20 '-O1', '-O2' or '-O3' set : results match, all 9.99999xxx,=20=20 different evaluation at compile- vs. runtime? I seem to remember similar oddities when a compiler replaces long double constants with doubles at com= pile time????=20=20 but why here? me in error? me stupid, me blackout? or is gcc / glibc / ??? kidding with the programmers?=20=20 admit to be confused, esp. about this error being dependent on compiler options, while the test program by M Welinder, and gnumeric where the prob= lem first came up, are not. --=20 You are receiving this mail because: You are on the CC list for the bug.=