From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 74B5838582B4; Mon, 24 Oct 2022 06:22:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 74B5838582B4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1666592573; bh=SGfGpOh81aVyEGL41VncvW+FqagI/bMJ+uT0i0bsx4E=; h=From:To:Subject:Date:In-Reply-To:References:From; b=jycjMZJg0M6C+kCb+gFjejd/pv/D7hCJurDoLM3DqtGZENIZAD92aEedo9iFRzsNp BaE4X5ZumHF7cdvvaZbj2Qvj6uawediXrNuFE10BfYZaJQ5O/aPs74WQDCChHpr6T2 XM8PEXXR6kgyKIyrt6wvyW3pPiJbhAx0AST3BBbk= From: "jacob at jacob dot remcomp.fr" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/107370] long double precision is wrong in ARM 64 Date: Mon, 24 Oct 2022 06:22:53 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 10.2.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jacob at jacob dot remcomp.fr X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.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://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D107370 --- Comment #1 from jacob navia --- This program produces correct results: #include #include long double nsqrt(long double x) { double m =3D sqrt(x); long double r =3D m; r =3D (r+x/r)/2.0L; r =3D (r+x/r)/2.0L; r =3D (r+x/r)/2.0L; r =3D (r+x/r)/2.0L; r =3D (r+x/r)/2.0L; return r; } int main(void) { printf("%.30Lg \n",nsqrt(2.0L)); } produces: 1.41421356237309504880168872421=20 All digits que OK. jacob=