2 -- reporter: Laurent Guerby <laurent@guerby.net>
5 procedure Conv_Decimal
is
7 type Unsigned_Over_8
is mod 2**8+2;
8 type Signed_Over_8
is range -200 .. 200;
10 procedure Assert
(Truth
: Boolean) is
17 type Decim
is delta 0.1 digits 5;
19 Halfway
: Decim
:= 2.5;
20 Neg_Half
: Decim
:= -2.5;
22 Big
: Unsigned_Over_8
;
23 Also_Big
: Signed_Over_8
;
26 Big
:= Unsigned_Over_8
(Halfway
); -- Rounds up by 4.6(33).
29 Also_Big
:= Signed_Over_8
(Halfway
); -- Rounds up by 4.6(33).
32 Also_Big
:= Signed_Over_8
(Neg_Half
); -- Rounds down by 4.6(33).
33 Assert
(Also_Big
= -3);