home *** CD-ROM | disk | FTP | other *** search
- --
- -- Copyright (C) 1996 Ada Resource Association (ARA), Columbus, Ohio.
- -- Author: Gilles Demailly
- --
- --
- -- Permission to use, copy, modify, and distribute this software and its
- -- documentation for any purpose and without fee is hereby granted,
- -- provided that the above copyright and authorship notice appear in all
- -- copies and that both that copyright notice and this permission notice
- -- appear in supporting documentation.
- --
- -- The ARA makes no representations about the suitability of this software
- -- for any purpose. It is provided "as is" without express
- -- or implied warranty.
- --
-
- with Ada.Text_Io;
-
- with Float_64_Io;
-
- package body CP.Long_Floats is
-
- use Byte_Utilities;
-
- procedure Decode (From_File : Byte_Utilities.File_Type;
- Some_Info : access Long_Floats) is
- begin
- Some_Info.Tag := C_Class_Tag;
-
- -- Reads the double value
- -------------------------
- Read (From_File, Some_Info.Float_Value);
- end Decode;
-
- procedure Display (Some_Info : access Long_Floats;
- Context : in Acc_CP_Infos) is
- begin
- -- the two tests are necessary because Float_64_Io could not
- -- handle Infinity values (+ and -) when I did test it
- -- with the Java class Double, my executable went to an
- -- infinite loop.
- ------------------------------------------------------------
- if Some_Info.Float_Value >= Float_64'Last then
- Ada.Text_Io.Put ("Inf");
- elsif Some_Info.Float_Value <= Float_64'First then
- Ada.Text_Io.Put ("-Inf");
- else
- -- Display the double value
- ---------------------------
- Float_64_Io.Put (Some_Info.Float_Value);
- end if;
- end Display;
-
- function Use_Two_Indexes_In_Table
- (Some_Info : access Long_Floats) return Boolean is
- begin
- return True;
- end Use_Two_Indexes_In_Table;
-
- end CP.Long_Floats;
-