comp.lang.ada
 help / color / mirror / Atom feed
* Float_text_io.put (10.0) -> 0.0 !
@ 2000-03-27  0:00 J�r�me Haguet
  2000-03-27  0:00 ` Robert Dewar
  2000-03-27  0:00 ` Florian Weimer
  0 siblings, 2 replies; 4+ messages in thread
From: J�r�me Haguet @ 2000-03-27  0:00 UTC (permalink / raw)


Hello
Does anybody know why the following code give on SOME PCs (not all) the
following outpout :

Wrong result with gnat 3.12p for Windows NT on some PCs
Next output should be "10.00" : 10.00
Next output should be "10.00" :  0.00

If you also have ideas to avoid this problem, you are welcome.



with Ada.Text_Io;
with Ada.Float_Text_Io;
with Win32.Windef;
with Win32.Wingdi;
with Win32.Winuser;

procedure Gnat_032 is
   pragma Linker_Options("-lopengl32");
begin
   Ada.Text_Io.Put_Line ("Wrong result with gnat 3.12p for Windows NT on
some PCs");
   ---
   Ada.Text_Io.Put ("Next output should be ""10.00"" : ");
   Ada.Float_Text_Io.Put (10.0, Aft => 2, Exp => 0);
   Ada.Text_Io.New_Line;
   ---
   declare
      Maindc : Win32.Windef.Hdc
        := Win32.Winuser.Getdc (Win32.Winuser.Hwnd_Top);
      Pfd : aliased Win32.Wingdi.Pixelformatdescriptor
        := (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0);
      Ipixelformat : Win32.Int
        := Win32.Wingdi.Choosepixelformat (mainDc, Pfd'Unchecked_Access);
      B : Win32.Bool
        := Win32.Wingdi.Setpixelformat (mainDc, Ipixelformat,
Pfd'Unchecked_Access);
      Glrc : Win32.Windef.Hglrc
        := Win32.Wingdi.Wglcreatecontext (mainDc);
   begin
      null;
   end;
   ---
   Ada.Text_Io.Put ("Next output should be ""10.00"" : ");
   Ada.Float_Text_Io.Put (10.0, Aft => 2, Exp => 0);
   Ada.Text_Io.New_Line;
end;







^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2000-03-28  0:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-03-27  0:00 Float_text_io.put (10.0) -> 0.0 ! J�r�me Haguet
2000-03-27  0:00 ` Robert Dewar
2000-03-28  0:00   ` Nicolas Brunot
2000-03-27  0:00 ` Florian Weimer

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