From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,3fec9418c677c0c7 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2004-01-15 06:20:07 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!eusc.inter.net!cs.tu-berlin.de!uni-duisburg.de!not-for-mail From: Georg Bauhaus Newsgroups: comp.lang.ada Subject: Re: Gnat's Ada.Float_Text_IO.Put problem Date: Thu, 15 Jan 2004 14:20:04 +0000 (UTC) Organization: GMUGHDU Message-ID: References: <8c4gd1-ifb.ln1@beastie.ix.netcom.com> NNTP-Posting-Host: l1-hrz.uni-duisburg.de X-Trace: a1-hrz.uni-duisburg.de 1074176404 29423 134.91.1.34 (15 Jan 2004 14:20:04 GMT) X-Complaints-To: usenet@news.uni-duisburg.de NNTP-Posting-Date: Thu, 15 Jan 2004 14:20:04 +0000 (UTC) User-Agent: tin/1.5.8-20010221 ("Blue Water") (UNIX) (HP-UX/B.11.00 (9000/800)) Xref: archiver1.google.com comp.lang.ada:4436 Date: 2004-01-15T14:20:04+00:00 List-Id: Stefano M. wrote: : I suddenly recalled there was a -S switch somewhere, here's what I get: [slightly condensed:] $LC0: .long 1092745167 ldgp $29,0($27) stack pointer, 0(kernel register) lda $30,-16($30) saved, -16(saved) lda $1,$LC0 load address register $1, $LC0 (there is 1092745167) lds $f10,0($1) $f10 is a floating point register sts $f10,0($30) (indirectly $LC0 if I'm not mistaken) lda $30,16($30) mirrors second line ret $31,($26),1 (31: return address, 26: kernel register) the 1092745167 from $LC0: is 16#4121F7CF#. It is the same as the number from offset 6: in the x86 example, 6: b8 cf f7 21 41 mov $0x4121f7cf,%eax <<---- In binary, this number and its negative (tried for checking) read 2#0_10000010_01000011111011111001111# 2#1_10000010_01000011111011111001111# In IEEE single precision this means sign: + sign: - Exponent: 130 - 127 = 3 Exponent: 130 - 127 = 3 fraction: (1.)01000011111011111001111 fraction: (1.)01000011111011111001111 With a left_shift of 3 (because exponent = 3) the resulting number is 2#1010.00011111011111001111# = (-)1.01230E+01 = (-)10.123. If this interpretation is correct then there is indeed no representation problem. (I'm not really familiar with any CPU or fpt, so caveat lector.) -- Georg