Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LRH.2.02.1901281753250.16424@key0.esi.com.au>
Date: Mon, 28 Jan 2019 17:59:53 +1100 (AEDT)
From: Damian McGuckin <damianm@....com.au>
To: musl@...ts.openwall.com
Subject: Possible Mistype in exp.c


In 1.1.21 in exp.c

        if (x < -708.39641853226410622) {
             /* underflow if x!=-inf */
             FORCE_EVAL((float)(-0x1p-149/x));
             if (x < -745.13321910194110842)

The constant also appears is expf.c.

For floats and for floats, the constant

 	0x1p-149

is the smallest non-zero finite number and will do the right thing.

Using that with doubles will not trigger an underflow exception.

I believe that for doubles, this needs to be

 	0x1p-1074

for doubles, i.e. 0x1p-1022 * 0x1p-52 if you want a conceptual match.

Regards - Damian

Pacific Engineering Systems International, 277-279 Broadway, Glebe NSW 2037
Ph:+61-2-8571-0847 .. Fx:+61-2-9692-9623 | unsolicited email not wanted here
Views & opinions here are mine and not those of any past or present employer

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.