X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f X-Recipient: djgpp AT delorie DOT com X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_20,T_RP_MATCHES_RCVD, URIBL_BLOCKED autolearn=disabled version=3.3.2 Date: Sat, 03 Feb 2018 10:13:38 +0200 Message-Id: <83shaibidp.fsf@gnu.org> From: "Eli Zaretskii (eliz AT gnu DOT org) [via djgpp AT delorie DOT com]" To: djgpp AT delorie DOT com In-reply-to: <5A74B159.4020603@gmx.de> (djgpp@delorie.com) Subject: Re: Fixing various bugs in frexp.S References: <5A4946EB DOT 3090500 AT gmx DOT de> <279ab41f-d898-4bcf-b5d4-ad9bf86e7a06 AT googlegroups DOT com> <83lgh86tza DOT fsf AT gnu DOT org> <5A74B159 DOT 4020603 AT gmx DOT de> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk > Date: Fri, 02 Feb 2018 19:43:37 +0100 > From: "Juan Manuel Guerrero (juan DOT guerrero AT gmx DOT de) [via djgpp AT delorie DOT com]" > > libc/ansi/math/frexp.S has simple bugs. It only returns correct > values for normalized numbers and for positive zero. Also in > case of error it sets errno to EDOM and this is wrong as can be > read in any man page of frexp. Case of error means that the > imput value is ether infinity or NaN. For negative zero, +/- NaN > and +/- infinity the values are simple wrong. Below are the results > as are generated by djdev205: I believe all of those "bugs" are due to the fact that our libc was developed when current versions of ANSI and Posix standards did not yet exist. We used much older versions of those standards, and the above behavior matches what they said. IOW, it's not like we didn't read "any man page of frexp", it's more like those man pages used to say something different 20 years ago.