[gtkada] Bug with Float'Image

Michael Gonzalez mgh at unican.es
Fri Nov 30 09:51:34 CET 2001


Hi,

I found an interesting bug involving Float'Image on Windows 2000. If I
run this program:

with Ada.Text_IO; use Ada.Text_IO;
with Gtk.Main;
procedure test_value is
   Y : Float := 3.45678;
begin
   --Gtk.Main.Init;
   Put_Line("Y="&Float'Image(Y));
end Test_Value;

I get on the screen the correct output: Y= 3.45678E+00

But if I uncomment the Gtk.Main.Init line and run the program then I
get:

    Y= 3.46111E+00

It seems that initializing Gtk changes the implementation of
Float'Image. But this only happens on Windows 2000. I have tried in
Linux, Windows 98 and Windows NT, and Float'Image works fine in those
OSs.

Any ideas? Any suggestion for a (portable) workaround?

Best regards,

Michael Gonzalez.
-----------------------------------------------------------------------
Michael Gonzalez Harbour                      E-mail: mgh at unican.es
Dpto. de Electronica y Computadores
Universidad de Cantabria                      Phone : +34-942-201483
Avda. de los Castros s/n
E-39005 Santander                             Fax   : +34-942-201402
SPAIN
-----------------------------------------------------------------------




More information about the gtkada mailing list