comp.lang.ada
 help / color / mirror / Atom feed
From: "Stefano M." <stefano.m@nospam.tin.it>
Subject: Re: Gnat's Ada.Float_Text_IO.Put problem
Date: Thu, 15 Jan 2004 09:46:54 +0100
Date: 2004-01-15T09:46:54+01:00	[thread overview]
Message-ID: <bu5k0n$4f4$1@grillo.cs.interbusiness.it> (raw)
In-Reply-To: <bu4rue$q8s$1@a1-hrz.uni-duisburg.de>

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



  reply	other threads:[~2004-01-15  8:46 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-14 13:39 Gnat's Ada.Float_Text_IO.Put problem Stefano M.
2004-01-14 14:58 ` Adrian Knoth
     [not found] ` <8c4gd1-ifb.ln1@beastie.ix.netcom.com>
2004-01-14 16:11   ` Stefano M.
2004-01-14 16:44     ` Adrian Knoth
2004-01-15  8:14       ` Stefano M.
2004-01-15  8:39         ` Adrian Knoth
2004-01-15 18:50         ` tmoran
2004-01-16  8:23           ` Duncan Sands
2004-01-16  8:48             ` tmoran
2004-01-16  9:45               ` Duncan Sands
2004-01-16 13:18                 ` Jeff C,
2004-01-16 13:52                   ` Duncan Sands
2004-01-15  1:55     ` Georg Bauhaus
2004-01-15  8:46       ` Stefano M. [this message]
2004-01-15 11:56         ` Georg Bauhaus
2004-01-15 11:02       ` Stefano M.
2004-01-15 14:20         ` Georg Bauhaus
2004-01-15  1:50 ` Jeff C,
2004-01-15  8:18   ` Stefano M.
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox