--  A digits constraint on a decimal fixed-point subtype (RM 3.5.9): its digits, and its range
--  (given, or the one its digits give); a universal operand of a membership test is of the
--  tested subtype's type.
with Ada.Text_IO; use Ada.Text_IO;
procedure Main is
   type Money is delta 0.01 digits 10;
   subtype M6 is Money digits 6;
   subtype M4 is Money digits 4 range 0.0 .. 10.0;
   subtype M5 is M6 digits 5;
   subtype Same is M6;
   X : constant M6 := 1234.56;
   Y : constant M4 := 9.99;
   Z : constant Money digits 3 := -9.99;
begin
   Put_Line (M6'Image (X) & M4'Image (Y) & Money'Image (Z));
   Put_Line (Integer'Image (M6'Digits) & Integer'Image (M4'Digits) & Integer'Image (M5'Digits) & Integer'Image (Same'Digits) & Integer'Image (Money'Digits));
   Put_Line (M6'Image (M6'First) & M6'Image (M6'Last) & M5'Image (M5'Last));
   Put_Line (Boolean'Image (12345.0 in M6) & Boolean'Image (9999.99 in M6));
end Main;
