From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111c93,892a9a16d63ae574,start X-Google-Attributes: gid111c93,public From: Joachim Wesner Subject: scanf/glibc bug for very small numbers !!! Date: 1998/11/17 Message-ID: <3651D53D.53D2DEEC@frankfurt.netsurf.de>#1/1 X-Deja-AN: 412876185 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii X-Trace: 17 Nov 1998 20:57:59 -0100, deck-195.frankfurt.netsurf.de Organization: OMNILINK -- your link to the Net MIME-Version: 1.0 Newsgroups: comp.os.linux.alpha Hi, when checking handling of denormalized numbers in the soon to be released new libffm version, I stumbled over a bug in scanf on my system (Still RH 4.2, I had not yet time to upgrade it - but hopefully next week -, however, as Kazushige Goto just checked on his NON RH system it seems to be an error of any glibc scanf): When reading a floating point number to a double with scanf I get the following results: Input Hex of double prec. # 1e-307 -> 0x0031f...... Regular number, OK 1e-308 -> 0x03f25...... !!!!!!!!!!!! WRONG !!!!!!!! 1e-309 -> 0x0000b...... Denormalized, OK It seems that also 10e-309, 100e-310 etc. lead to the same bug. Can anybody comment on this ??? Where is the source for the core routine that does the conversion ?? If I'd know, I'd try to find the location of the bug and fix it. Joachim