comp.lang.ada
 help / color / mirror / Atom feed
* Float precision - gnat vs objectada
@ 2004-12-01 15:46 P Torle
  2004-12-01 18:50 ` David C. Hoos
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: P Torle @ 2004-12-01 15:46 UTC (permalink / raw)


I'm working on a Ada95/C project that shall run on both Linux and
Windows.
I have some problems getting the same float precision on both
platforms.
Example:
-----------------------------
subtype Real is Long_Float;
pi : Real;

pi := 3.14159_26535_89793_23846_26433_83279_50288_41971_69399_37511;
Real_Io.Put(pi, Aft => 25);
-----------------------------

Results:
Linux: 3.1415926535897931200000000E+00
Win32: 3.1415926535897931159979634E+00

The thing is, the following float-precision definitions are equal on
both Linux and Windows:

Real'Machine_Mantissa  : 53
Real'Machine_Emin      : -1021
Real'Machine_Emax      : 1024
Real'Digits            : 15

So why the difference? 

The Windows code is built with ObjectAda/adacomp and Microsoft tools
cl.exe/link.exe.
The Linux code is built with gnat/gcc 3.4.2



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

end of thread, other threads:[~2004-12-02 10:10 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-12-01 15:46 Float precision - gnat vs objectada P Torle
2004-12-01 18:50 ` David C. Hoos
2004-12-01 19:03 ` Martin Krischik
2004-12-02  7:51   ` Jeffrey Carter
2004-12-02 10:10     ` Martin Krischik
2004-12-01 23:32 ` Mark Lorenzen
2004-12-02  8:32 ` Dmitry A. Kazakov

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