From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C79AB3858412; Mon, 24 Jan 2022 21:45:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C79AB3858412 From: "mwelinder at gmail dot com" To: glibc-bugs@sourceware.org Subject: [Bug math/28472] pow(10, i) accuracy Date: Mon, 24 Jan 2022 21:45:47 +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: mwelinder at gmail dot com 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 X-BeenThere: glibc-bugs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Glibc-bugs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jan 2022 21:45:47 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D28472 --- Comment #6 from M Welinder --- > I'd encourage using exp10 At present that seems to be a very bad idea. The accuracy is worse than pow(10,i). For example, here are the integer powers of 10 from 0-21. Problems with 6/= 22 results. 1.00000000000000000000000000000000000 10.00000000000000000000000000000000000 100.00000000000000000000000000000000000 1000.00000000000011368683772161602973938 10000.00000000000181898940354585647583008 100000.00000000000000000000000000000000000 1000000.00000000000000000000000000000000000 9999999.99999999813735485076904296875000000 99999999.99999998509883880615234375000000000 999999999.99999988079071044921875000000000000 10000000000.00000000000000000000000000000000000 100000000000.00000000000000000000000000000000000 1000000000000.00000000000000000000000000000000000 10000000000000.00000000000000000000000000000000000 100000000000000.00000000000000000000000000000000000 1000000000000000.00000000000000000000000000000000000 10000000000000000.00000000000000000000000000000000000 99999999999999984.00000000000000000000000000000000000 1000000000000000000.00000000000000000000000000000000000 10000000000000000000.00000000000000000000000000000000000 100000000000000000000.00000000000000000000000000000000000 1000000000000000000000.00000000000000000000000000000000000 --=20 You are receiving this mail because: You are on the CC list for the bug.=