public inbox for newlib-cvs@sourceware.org
help / color / mirror / Atom feed
From: Jeff Johnston <jjohnstn@sourceware.org>
To: newlib-cvs@sourceware.org
Subject: [newlib-cygwin] Delete check in catan, catanf, and catanl functions.
Date: Tue, 10 Oct 2023 19:19:01 +0000 (GMT)	[thread overview]
Message-ID: <20231010191901.E88F03858CDB@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=dcb2b7d7b8456827d4cd82b5798526e7cd483e36

commit dcb2b7d7b8456827d4cd82b5798526e7cd483e36
Author: Joseph Faulls <Joseph.Faulls@imgtec.com>
Date:   Tue Oct 10 15:12:00 2023 -0400

    Delete check in catan, catanf, and catanl functions.
    
    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.
    
    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)
 
 	x2 = x * x;
 	a = 1.0 - x2 - (y * y);
-	if (a == 0.0)
-		goto ovrf;
 
 	t = 0.5 * atan2(2.0 * x, a);
 	w = _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)
 
 	x2 = x * x;
 	a = 1.0f - x2 - (y * y);
-	if (a == 0.0f)
-		goto ovrf;
 
 	t = 0.5f * atan2f(2.0f * x, a);
 	w = _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)
 
 	x2 = x * x;
 	a = 1.0L - x2 - (y * y);
-	if (a == 0.0)
-		goto ovrf;
 
 	t = 0.5L * atan2l(2.0L * x, a);
 	w = _redupil(t);

                 reply	other threads:[~2023-10-10 19:19 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20231010191901.E88F03858CDB@sourceware.org \
    --to=jjohnstn@sourceware.org \
    --cc=newlib-cvs@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: link
Be 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).