--  T'Mod (X) of an X whose type cannot hold T's modulus (an Integer for a 64-bit or 128-bit
--  T), and conversions from a modular type to a floating-point or fixed-point one (RM 4.6(8)).
with Ada.Text_IO; use Ada.Text_IO;
with Interfaces; use Interfaces;

procedure Main is
   type Big is mod 2 ** 128;
   type Odd is mod 2 ** 64 - 1;
   type Seven is mod 7;
   type Money is delta 0.25 range 0.0 .. 1000.0;
   I : constant Integer := -1;
   N : Natural := 3;
   J : Integer := 1;
   B : Unsigned_8 := 100;
   U : Unsigned_64;
   F : Float;
   L : Long_Float;
   M : Money;
begin
   N := N + 7;
   J := J - 4;
   B := B * 2;
   U := Unsigned_64'Mod (I);
   Put_Line (U'Image);
   U := Unsigned_64'Mod (N);
   Put_Line (U'Image);
   Put_Line (Big'Mod (I)'Image);
   Put_Line (Big'Mod (J)'Image);
   Put_Line (Odd'Mod (I)'Image);
   Put_Line (Odd'Mod (J)'Image);
   Put_Line (Seven'Mod (I)'Image);
   Put_Line (Seven'Mod (N)'Image);
   Put_Line (Unsigned_64'Mod (B)'Image);
   Put_Line (Unsigned_8'Mod (U)'Image);
   F := Float (Unsigned_64'(2 ** 40));
   Put_Line (Long_Long_Integer (F)'Image);
   L := Long_Float (Unsigned_64'Last);
   Put_Line (Boolean'Image (L > 1.8E19));
   M := Money (Unsigned_8'(37));
   Put_Line (M'Image);
   U := Unsigned_64 (M);
   Put_Line (U'Image);
end Main;
