Jump to content

Ada Programming/Attributes/'Min

From Wikibooks, open books for an open world

Ada. Time-tested, safe and secure.
Ada. Time-tested, safe and secure.

Description

[edit | edit source]

'Min(X, Y) is a scalar type attribute. It returns the lesser of the two parameters.

Example

[edit | edit source]
type My_Enum is (Enum1, Enum2, Enum3);
A : Integer :=  3;
B : Integer := -5;
X : Float :=  1.0;
Y : Float :=  1.5;
-- ...
pragma Assert (My_Enum'Min(Enum3, Enum1) = Enum1); 
pragma Assert (Integer'Min(A, B) = -5);
pragma Assert (Float'Min(X, Y) = 1.0);

See also

[edit | edit source]

Wikibook

[edit | edit source]

Ada Reference Manual

[edit | edit source]