public inbox for newlib@sourceware.org
 help / color / mirror / Atom feed
From: Keith Packard <keithp@keithp.com>
To: newlib@sourceware.org
Subject: NaN fixes in pow, powf, modf, modff
Date: Wed, 25 Mar 2020 17:18:18 -0700	[thread overview]
Message-ID: <20200326001821.174426-1-keithp@keithp.com> (raw)

The first patch makes modf set *iptr to qnan when provided an snan
parameter, which wasn't happening on ARM softfp because GCC elided the
* 1.0 operation.

The second patch cleans up modf/modff by not re-converting the float
to bits before extracting the sign bit.

The third patch makes pow return qnan instead of 1.0 when the
parameter is snan.

These functions now match glibc for all of my tests, which were
derived from the IEEE requirements.



             reply	other threads:[~2020-03-26  0:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-26  0:18 Keith Packard [this message]
2020-03-26  0:18 ` [PATCH 1/3] newlib/libm/common: Fix modf/modff returning snan Keith Packard
2020-03-26  0:18 ` [PATCH 2/3] newlib/libm/common: Don't re-convert float to bits in modf/modff Keith Packard
2020-03-26  0:18 ` [PATCH 3/3] newlib/libm/math: Make pow/powf return qnan for snan arg Keith Packard
2020-03-26 11:42 ` NaN fixes in pow, powf, modf, modff Corinna Vinschen

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=20200326001821.174426-1-keithp@keithp.com \
    --to=keithp@keithp.com \
    --cc=newlib@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).