Aft : Field;
Exp : Field)
is
- Buf : String (1 .. 3 * Field'Last + 2);
+ Buf : String (1 .. Max_Real_Image_Length);
Ptr : Natural := 0;
begin
Aft : Field;
Exp : Field)
is
- Buf : String (1 .. 3 * Field'Last + 2);
+ Buf : String (1 .. Max_Real_Image_Length);
Ptr : Natural := 0;
begin
Scale : Integer;
Expon : Integer;
- Field_Max : constant := 255;
- -- This should be the same value as Ada.[Wide_]Text_IO.Field'Last.
- -- It is not worth dragging in Ada.Text_IO to pick up this value,
- -- since it really should never be necessary to change it.
-
- Digs : String (1 .. 2 * Field_Max + 16);
- -- Array used to hold digits of converted integer value. This is a
- -- large enough buffer to accommodate ludicrous values of Fore and Aft.
+ Digs : String (1 .. Max_Real_Image_Length);
+ -- Array used to hold digits of converted integer value. This is a large
+ -- enough buffer to accommodate ludicrous Fore/Aft/Exp combinations.
Ndigs : Natural;
-- Number of digits stored in Digs (and also subscript of last digit)
-- can be set to any valid values for the case of use from Text_IO. Note
-- that no space is stored at the start for non-negative values.
+ Max_Real_Image_Length : constant := 5200;
+ -- If Exp is set to zero and Aft is set to Text_IO.Field'Last (i.e., 255)
+ -- then Long_Long_Float'Last generates an image whose length is
+ -- slightly less than 5200.
+
end System.Img_Real;