1 ------------------------------------------------------------------------------
3 -- GNAT RUN-TIME COMPONENTS --
5 -- S Y S T E M . I M G _ R E A L --
9 -- Copyright (C) 1992-2009, Free Software Foundation, Inc. --
11 -- GNAT is free software; you can redistribute it and/or modify it under --
12 -- terms of the GNU General Public License as published by the Free Soft- --
13 -- ware Foundation; either version 3, or (at your option) any later ver- --
14 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
15 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
16 -- or FITNESS FOR A PARTICULAR PURPOSE. --
18 -- As a special exception under Section 7 of GPL version 3, you are granted --
19 -- additional permissions described in the GCC Runtime Library Exception, --
20 -- version 3.1, as published by the Free Software Foundation. --
22 -- You should have received a copy of the GNU General Public License and --
23 -- a copy of the GCC Runtime Library Exception along with this program; --
24 -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
25 -- <http://www.gnu.org/licenses/>. --
27 -- GNAT was originally developed by the GNAT team at New York University. --
28 -- Extensive contributions were provided by Ada Core Technologies Inc. --
30 ------------------------------------------------------------------------------
32 -- Image for fixed and float types (also used for Float_IO/Fixed_IO output)
34 package System
.Img_Real
is
37 procedure Image_Ordinary_Fixed_Point
42 -- Computes fixed_type'Image (V) and returns the result in S (1 .. P)
43 -- updating P on return. The result is computed according to the rules for
44 -- image for fixed-point types (RM 3.5(34)), where Aft is the value of the
45 -- Aft attribute for the fixed-point type. This function is used only for
46 -- ordinary fixed point (see package System.Img_Dec for handling of decimal
47 -- fixed-point). The caller guarantees that S is long enough to hold the
48 -- result and has a lower bound of 1.
50 procedure Image_Floating_Point
55 -- Computes fixed_type'Image (V) and returns the result in S (1 .. P)
56 -- updating P on return. The result is computed according to the rules for
57 -- image for floating-point types (RM 3.5(33)), where Digs is the value of
58 -- the Digits attribute for the floating-point type. The caller guarantees
59 -- that S is long enough to hold the result and has a lower bound of 1.
61 procedure Set_Image_Real
68 -- Sets the image of V starting at S (P + 1), updating P to point to the
69 -- last character stored, the caller promises that the buffer is large
70 -- enough and no check is made for this. Constraint_Error will not
71 -- necessarily be raised if this is violated, since it is perfectly valid
72 -- to compile this unit with checks off). The Fore, Aft and Exp values
73 -- can be set to any valid values for the case of use from Text_IO. Note
74 -- that no space is stored at the start for non-negative values.