mailing list of musl libc
 help / color / mirror / code / Atom feed
From: ardi <ardillasdelmonte@gmail.com>
To: musl@lists.openwall.com
Subject: Re: [musl] Do you recommend using fmt_fp() and
Date: Mon, 5 Sep 2022 10:49:18 +0200	[thread overview]
Message-ID: <CA+fZqCVih-Vv4sGfML5p5SZ4fspuz1ADnEPBpmJObRes+cv2ug@mail.gmail.com> (raw)
In-Reply-To: <20220904215927.GB9709@brightrain.aerifal.cx>

On Sun, Sep 4, 2022 at 11:59 PM Rich Felker <dalias@libc.org> wrote:
>
> It's not about the exponent size but the mantissa size, and the
> numbers 64 and 120 are completely arbitrary except for being larger
> than the number of mantissa bits and small enough not to overflow (so
> at most a little under twice the max exponent).

Thanks a lot, Rich! After having substituted all the C arithmetic
expressions and libm functions by calls to the SoftFloat functions for
binary128 (and implementing some libm functions not provided by
SoftFloat), I got the FP->String and the String->FP conversion working,
with a 100% software implementation of binary128!!

I tested the round-trip FP->String->FP for a few cases (PI, -PI, 1/3 and
-1/3), using precision 36 (DECIMAL_DIG for binary128), and the
round-trip is successful for binary128!! (yes, I used full-128bit PI from
here: https://www.chusov.org/fp_constants.html )

Of course I need to test this with more numbers, and with a loop of a
zillion random numbers, but for the moment I'm _very_ happy.

I need to tidy it up a bit, and I'd like to implement more libm functions
(ideally I'd wish to provide the full libm catalog). When it's ready, I'll
publish the source in github or similar.

Thanks a lot!!

César

      reply	other threads:[~2022-09-05  8:49 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-18 15:51 ardi
2022-08-19  3:19 ` Rich Felker
2022-08-23 17:00   ` ardi
2022-08-23 17:30     ` Rich Felker
2022-08-30 10:17       ` ardi
2022-08-30 12:26         ` Rich Felker
2022-09-04 19:52           ` ardi
2022-09-04 21:59             ` Rich Felker
2022-09-05  8:49               ` ardi [this message]

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=CA+fZqCVih-Vv4sGfML5p5SZ4fspuz1ADnEPBpmJObRes+cv2ug@mail.gmail.com \
    --to=ardillasdelmonte@gmail.com \
    --cc=musl@lists.openwall.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

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 NNTP newsgroup(s).