(2)
function "*" (Left, Right : T) return T
function "/" (Left, Right : T) return T
function "mod"(Left, Right : T) return T
function "rem"(Left, Right : T) return T
(5)
A = (A/B)*B + (A rem B)
(7)
(-A)/B = -(A/B) = A/(-B)
(9)
A = B*N + (A mod B)
(12)
function "*"(Left, Right : T) return T
function "/"(Left, Right : T) return T
(14)
function "*"(Left : T; Right : Integer) return T
function "*"(Left : Integer; Right : T) return T
function "/"(Left : T; Right : Integer) return T
(16)
function "*"(Left, Right : root_real) return root_real
function "/"(Left, Right : root_real) return root_real
(17)
function "*"(Left : root_real; Right : root_integer) return root_real
function "*"(Left : root_integer; Right : root_real) return root_real
function "/"(Left : root_real; Right : root_integer) return root_real
(19)
function "*"(Left, Right : universal_fixed) return universal_fixed
function "/"(Left, Right : universal_fixed) return universal_fixed
(24)
A rem (-B) = A rem B
(-A) rem B = -(A rem B)
(26)
A mod B = (A + K*B) mod B
(28)
A B A/B A rem B A mod B A B A/B A rem B A mod B
(29)
10 5 2 0 0 -10 5 -2 0 0
11 5 2 1 1 -11 5 -2 -1 4
12 5 2 2 2 -12 5 -2 -2 3
13 5 2 3 3 -13 5 -2 -3 2
14 5 2 4 4 -14 5 -2 -4 1
(30)
A B A/B A rem B A mod B A B A/B A rem B A mod B
10 -5 -2 0 0 -10 -5 2 0 0
11 -5 -2 1 -4 -11 -5 2 -1 -1
12 -5 -2 2 -3 -12 -5 2 -2 -2
13 -5 -2 3 -2 -13 -5 2 -3 -3
14 -5 -2 4 -1 -14 -5 2 -4 -4
(32)
I : Integer := 1;
J : Integer := 2;
K : Integer := 3;
(33)
X : Real := 1.0; -- see 3.5.7
Y : Real := 2.0;
(34)
F : Fraction := 0.25; -- see 3.5.9
G : Fraction := 0.5;
(35)
Expression Value Result Type
I*J 2 same as I and J, that is, Integer
K/J 1 same as K and J, that is, Integer
K mod J 1 same as K and J, that is, Integer
X/Y 0.5 same as X and Y, that is, Real
F/2 0.125 same as F, that is, Fraction
3*F 0.75 same as F, that is, Fraction
0.75*G 0.375 universal_fixed, implicitly convertible
to any fixed point type
Fraction(F*G) 0.125 Fraction, as stated by the conversion
Real(J)*Y 4.0 Real, the type of both operands after
conversion of J
-- Email comments, additions, corrections, gripes, kudos, etc. to: