---------------------------------------------------------------------- -- Title : FloaAKD -- Version : 1.0 -- Copyright : (C) 1994 David Wallace Croft. All rights reserved. -- Author : David Wallace Croft, CompuServe [76600,102] -- Compiler : Ada -- Description : Floating-point I/O. ---------------------------------------------------------------------- with TextAKD; use TextAKD; package FloaAKD is ---------------------------------------------------------------------- ---------------------------------------------------------------------- package Float_IO is new TextAKD.Float_IO_AKD ( float ); Default_Fore : constant Field := 2; Default_Aft : constant Field := 2; -- previously float'digits - 1; Default_Exp : constant Field := 4; -- previously 3; ---------------------------------------------------------------------- -- Instantiated from TextAKD.Float_IO_AKD ( float ) ---------------------------------------------------------------------- procedure Get ( File : in File_Type; Item : out float; Width : in Field := 0 ) renames Float_IO.Get; procedure Get ( Item : out float; Width : in Field := 0 ) renames Float_IO.Get; procedure Put ( File : in File_Type; Item : in float; Fore : in Field := Default_Fore; Aft : in Field := Default_Aft; Exp : in Field := Default_Exp ) renames Float_IO.Put; procedure Put ( Item : in float; Fore : in Field := Default_Fore; Aft : in Field := Default_Aft; Exp : in Field := Default_Exp ) renames Float_IO.Put; procedure Get ( From : in string; Item : out float; Last : out positive ) renames Float_IO.Get; procedure Put ( To : out string; Item : in float; Aft : in Field := Default_Aft; Exp : in integer := Default_Exp ) renames Float_IO.Put; ---------------------------------------------------------------------- -- Unique sub-programs ---------------------------------------------------------------------- function Ask ( Prompt : string := ""; Default : float := 0.0; Minimum : float := - float'safe_large; Maximum : float := + float'safe_large; Fore : Field := Default_Fore; Aft : Field := Default_Aft; Exp : Field := Default_Exp ) return float; procedure Put_Line ( Item : in float; Fore : in Field := Default_Fore; Aft : in Field := Default_Aft; Exp : in Field := Default_Exp ); procedure Put_Line ( File : in File_Type; Item : in float; Fore : in Field := Default_Fore; Aft : in Field := Default_Aft; Exp : in Field := Default_Exp ); ---------------------------------------------------------------------- ---------------------------------------------------------------------- end FloaAKD;