411 REFERENCE · Wikibooks
Ada Programming/Attributes/'Max
Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.
Attributes 'Max
__TOC__
Description
'Max(X, Y) is a scalar type attribute. It returns the greater of the two parameters.
Example
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'Max(Enum3, Enum1) = Enum3);
pragma Assert (Integer'Max(A, B) = 3);
pragma Assert (Float'Max(X, Y) = 1.5);
See also
Wikibook
Ada Programming
Ada Programming/Attributes
Ada Programming/Attributes/'Min
Ada Reference Manual
3 5 Scalar Types
K Language-Defined Attributes
Max