From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2134) id E88F03858CDB; Tue, 10 Oct 2023 19:19:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E88F03858CDB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1696965541; bh=ZzXbCZoGqo8ptnpeKIENh6NIZy65oYzbi9E+jDFqnbk=; h=From:To:Subject:Date:From; b=iIfyVbG7Myxw63YvtwruzXWErXVaB/q10LKQIOrf1tgNwfJ1URLKJtWlDvkdjvx4T 38VfigRVZfL9nPqItC6m8d215dpwNoQjAvc/QC0RkUiKXgqR7xZlzEWAoYs13IDaqr BM+Tq2EkqlNQlL5qj5BObewdXEEX2+XVXbdCWa9A= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Jeff Johnston To: newlib-cvs@sourceware.org Subject: [newlib-cygwin] Delete check in catan, catanf, and catanl functions. X-Act-Checkin: newlib-cygwin X-Git-Author: Joseph Faulls X-Git-Refname: refs/heads/master X-Git-Oldrev: fe5886a500e66cddf0f57eea3049d25d5f8765e9 X-Git-Newrev: dcb2b7d7b8456827d4cd82b5798526e7cd483e36 Message-Id: <20231010191901.E88F03858CDB@sourceware.org> Date: Tue, 10 Oct 2023 19:19:01 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3Ddcb2b7d7b84= 56827d4cd82b5798526e7cd483e36 commit dcb2b7d7b8456827d4cd82b5798526e7cd483e36 Author: Joseph Faulls Date: Tue Oct 10 15:12:00 2023 -0400 Delete check in catan, catanf, and catanl functions. =20 The check incorrectly results in catan returning nan + inf i when real = part is +/- 1 and imaginary part is 0. The same occurs for real 0.8 and imaginary 0.6. =20 The change ends up matching glibc behaviour. Diff: --- newlib/libm/complex/catan.c | 2 -- newlib/libm/complex/catanf.c | 2 -- newlib/libm/complex/catanl.c | 2 -- 3 files changed, 6 deletions(-) diff --git a/newlib/libm/complex/catan.c b/newlib/libm/complex/catan.c index 77510ec2f..34d75b849 100644 --- a/newlib/libm/complex/catan.c +++ b/newlib/libm/complex/catan.c @@ -105,8 +105,6 @@ catan(double complex z) =20 x2 =3D x * x; a =3D 1.0 - x2 - (y * y); - if (a =3D=3D 0.0) - goto ovrf; =20 t =3D 0.5 * atan2(2.0 * x, a); w =3D _redupi(t); diff --git a/newlib/libm/complex/catanf.c b/newlib/libm/complex/catanf.c index ac1a65c08..9dc2fb23f 100644 --- a/newlib/libm/complex/catanf.c +++ b/newlib/libm/complex/catanf.c @@ -54,8 +54,6 @@ catanf(float complex z) =20 x2 =3D x * x; a =3D 1.0f - x2 - (y * y); - if (a =3D=3D 0.0f) - goto ovrf; =20 t =3D 0.5f * atan2f(2.0f * x, a); w =3D _redupif(t); diff --git a/newlib/libm/complex/catanl.c b/newlib/libm/complex/catanl.c index ee2a25930..13839ac73 100644 --- a/newlib/libm/complex/catanl.c +++ b/newlib/libm/complex/catanl.c @@ -51,8 +51,6 @@ catanl(long double complex z) =20 x2 =3D x * x; a =3D 1.0L - x2 - (y * y); - if (a =3D=3D 0.0) - goto ovrf; =20 t =3D 0.5L * atan2l(2.0L * x, a); w =3D _redupil(t);