1with Ada.Unchecked_Conversion;
2
3package body Inline2_Pkg is
4
5   type Ieee_Short_Real is
6      record
7         Mantisse_Sign : Integer range 0 .. 1;
8         Exponent      : Integer range 0 .. 2 **  8 - 1;
9         Mantisse      : Integer range 0 .. 2 ** 23 - 1;
10      end record;
11
12   for Ieee_Short_Real use
13      record
14         Mantisse_Sign at 0 range 31 .. 31;
15         Exponent      at 0 range 23 .. 30;
16         Mantisse      at 0 range  0 .. 22;
17      end record;
18
19   function Valid_Real (Number : Float) return Boolean is
20      function To_Ieee_Short_Real is
21         new Ada.Unchecked_Conversion (Float, Ieee_Short_Real);
22   begin
23      return To_Ieee_Short_Real (Number).Exponent /= 255;
24   end Valid_Real;
25
26   function Invalid_Real return Float is
27      function To_Float is
28         new Ada.Unchecked_Conversion (Ieee_Short_Real, Float);
29   begin
30      return To_Float (Ieee_Short_Real'(Mantisse_Sign => 0,
31                                        Exponent => 255, Mantisse => 0));
32   end Invalid_Real;
33
34end Inline2_Pkg;
35