comp.lang.ada
 help / color / mirror / Atom feed
* Duration'Image, Duration'Value and Duration'Last
@ 2009-02-19 15:33 dhenry
  2009-02-19 15:44 ` Adam Beneschan
  0 siblings, 1 reply; 3+ messages in thread
From: dhenry @ 2009-02-19 15:33 UTC (permalink / raw)


Hello,

I'm experimenting something strange when manipulating Duration'Image,
Duration'Value and Duration'Last with GNAT :

The result of Duration'Value(Duration'Image(Duration'Last)) is
different from the result of S : String := Duration'Image
(Duration'Last) and then Duration'Value(S).

Here is a test program that shows the issue:

-----------------------------------------------------
with Ada.Text_IO; use Ada.Text_IO;

procedure Test is
   S : String   := Duration'Image (Duration'Last);
   D : Duration := Duration'Value (S);
begin
   Put_Line (Duration'Image (D));
   Put_Line (Duration'Image (Duration'Last));
end Test;
-----------------------------------------------------

This test program gives me:
-9223372036.854775810
 9223372036.854775810

Note that -9223372036.854775810 seems to be Duration'First...

Is it expected? Can someone tell me what happens here? why this
difference?

Yours,
David.



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

end of thread, other threads:[~2009-02-19 17:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-02-19 15:33 Duration'Image, Duration'Value and Duration'Last dhenry
2009-02-19 15:44 ` Adam Beneschan
2009-02-19 17:00   ` anon

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