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 01:04:34 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!news.mailgate.org!newsfeeder.edisontel.com!news-out.tin.it!news-in.tin.it!news!not-for-mail From: "Stefano M." Newsgroups: comp.lang.ada Subject: Re: Gnat's Ada.Float_Text_IO.Put problem Date: Thu, 15 Jan 2004 09:46:54 +0100 Organization: Centro Servizi Interbusiness Message-ID: References: <8c4gd1-ifb.ln1@beastie.ix.netcom.com> NNTP-Posting-Host: host26-54.pool21759.interbusiness.it Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Trace: grillo.cs.interbusiness.it 1074156375 4580 217.59.54.26 (15 Jan 2004 08:46:15 GMT) X-Complaints-To: news@interbusiness.it, abuse@interbusiness.it NNTP-Posting-Date: Thu, 15 Jan 2004 08:46:15 +0000 (UTC) User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.6b) Gecko/20031205 Thunderbird/0.4 X-Accept-Language: en-us, en In-Reply-To: Xref: archiver1.google.com comp.lang.ada:4429 Date: 2004-01-15T09:46:54+01:00 List-Id: Georg Bauhaus wrote: > Disassembly of section .text: > > 00000000 <_ada_main>: > 0: 55 push %ebp > 1: 89 e5 mov %esp,%ebp > 3: 83 ec 04 sub $0x4,%esp > 6: b8 cf f7 21 41 mov $0x4121f7cf,%eax <<---- > b: 89 45 fc mov %eax,0xfffffffc(%ebp) > e: c9 leave > f: c3 ret > > What do you get at <<----? Does it change when you add a few tenths? Georg, thank you for your message. Unfortunately, I didn't manage to find a disassembler on my target host. Anyway (and I apoligize in advance if I've misunderstood your message), I really doubt that my problem is related to a internal misrepresentation of floating point numbers (my own Image function do work, although for only "small" floats and with a relatively small precision). According to what I read on a ACT mailing list, the problem arises with the FPU being "switched" from 80 bit to 64 bit precision by other software and if you look at the library code for the image function you will find something like: procedure Set_Image_Real (V : Long_Long_Float; S : out String; P : in out Natural; Fore : Natural; Aft : Natural; Exp : Natural) is procedure Reset; pragma Import (C, Reset, "__gnat_init_float"); -- We import the floating-point processor reset routine so that we can -- be sure the floating-point processor is properly set for conversion -- calls (see description of Reset in GNAT.Float_Control (g-flocon.ads). -- This is notably need on Windows, where calls to the operating system -- randomly reset the processor into 64-bit mode. [...] -- Start of processing for Set_Image_Real begin Reset; Scale := 0; [...] I guess the problem is in some way caused by that 'Reset' procedure, either being not called because I am not compiling on Windows or being called no matter how. Stefano