Exception for division by interval containing zero Raised by "/" operator when Right operand contains zero @see IEEE 1788-2015 Section 8.2 "arithmetic operations"
function "*" (Left, Right : Interval) return Interval
Multiplies two intervals
First interval operand
Second interval operand
Result based on sign combinations of operands @see IEEE 1788-2015 Section 8.2 "arithmetic operations" @see IEEE 1788.1-2017 Section 10.8.3 "multiplication"
function "+" (Right : Interval) return Interval
Unary plus operator (identity function)
The interval to operate on
The same interval unchanged @see IEEE 1788-2015 Section 8.2 "arithmetic operations" @see IEEE 1788.1-2017 Section 10.8.1 "unary plus"
function "+" (Left, Right : Interval) return Interval
Adds two intervals
First interval operand
Second interval operand
[Left.Lower + Right.Lower, Left.Upper + Right.Upper] @see IEEE 1788-2015 Section 8.2 "arithmetic operations" @see IEEE 1788.1-2017 Section 10.8.1 "addition"
function "-" (Right : Interval) return Interval
Unary minus operator (negation)
The interval to negate
[-Right.Upper, -Right.Lower] @see IEEE 1788-2015 Section 8.2 "arithmetic operations" @see IEEE 1788.1-2017 Section 10.8.2 "negation"
function "-" (Left, Right : Interval) return Interval
Subtracts two intervals
First interval operand
Second interval operand
[Left.Lower - Right.Upper, Left.Upper - Right.Lower] @see IEEE 1788-2015 Section 8.2 "arithmetic operations" @see IEEE 1788.1-2017 Section 10.8.2 "subtraction"
function "/" (Left, Right : Interval) return Interval
Divides two intervals
First interval operand
Second interval operand
Result based on sign combinations of operands
if Right contains zero @see IEEE 1788-2015 Section 8.2 "arithmetic operations" @see IEEE 1788.1-2017 Section 10.8.4 "division"
function "<" (Left, Right : Interval) return Boolean
Tests strict containment
First interval
Second interval
True if Left strictly contains Right @see IEEE 1788-2015 Section 8.1 "set relations"
function "<=" (Left, Right : Interval) return Boolean
Tests non-strict containment
First interval
Second interval
True if Left contains or equals Right @see IEEE 1788-2015 Section 8.1 "set relations" @see IEEE 1788.1-2017 Section 10.7.2 "less than or equal"
function "=" (Left, Right : Interval) return Boolean
Tests interval equality
First interval
Second interval
True if intervals are equal @see IEEE 1788-2015 Section 8.1 "set relations"
function ">" (Left, Right : Interval) return Boolean
Tests if interval is strictly greater
First interval
Second interval
True if Left is entirely greater than Right @see IEEE 1788-2015 Section 8.1 "set relations" @see IEEE 1788.1-2017 Section 10.7.3 "greater than"
function ">=" (Left, Right : Interval) return Boolean
Tests if interval is greater or equal
First interval
Second interval
True if Left is greater than or equal to Right @see IEEE 1788-2015 Section 8.1 "set relations" @see IEEE 1788.1-2017 Section 10.7.3 "greater than or equal"
function "abs" (Right : Interval) return Interval
Returns the absolute value of an interval
The interval to take the absolute value of
Interval containing absolute values of all points in Right @see IEEE 1788-2015 Section 8.3 "absolute value" @see IEEE 1788.1-2017 Section 10.9.1 "absolute value"
function Entire return Interval
Returns an interval containing all representable values Creates an interval spanning the entire range of type T
An interval [T'First,T'Last] @see IEEE 1788-2015 Section 6.3 "interval literals" @see IEEE 1788.1-2017 Section 10.5.1 "entire"
function Hull (Left, Right : Interval) return Interval
Computes interval hull of two intervals
First interval
Second interval
Smallest interval containing both inputs @see IEEE 1788-2015 Section 6.4 "interval hulls"
function Hull (Right : IntervalElements) return Interval
Computes hull of interval array
Array of intervals
Smallest interval containing all inputs @see IEEE 1788-2015 Section 6.4 "interval hulls"
function Hull (Left, Right : T) return Interval
Computes interval hull of two numbers
First number
Second number
Smallest interval containing both inputs @see IEEE 1788-2015 Section 6.4 "interval hulls"
function Hull (Right : TElements) return Interval
Computes hull of number array
Array of numbers
Smallest interval containing all inputs @see IEEE 1788-2015 Section 6.4 "interval hulls"
type Interval is record
Lower_Bound : T;
Upper_Bound : T;
end record;
Internal interval representation Stores bounds with invariant Lower_Bound <= Upper_Bound
Lower bound of interval
Upper bound of interval
type IntervalElements is array (Integer range <>) of Interval;
Array of intervals for bulk operations Used for operations on multiple intervals @see IEEE 1788-2015 Section 6.2 "interval types"
Invalid_Arguments_To_Division : exception;
Exception for division by interval containing zero Raised by "/" operator when Right operand contains zero @see IEEE 1788-2015 Section 8.2 "arithmetic operations"
function Max (Left, Right : T) return T
Returns maximum of two numbers
First number
Second number
The larger value @see IEEE 1788-2015 Section 8.3
function Min (Left, Right : T) return T
Returns minimum of two numbers
First number
Second number
The smaller value @see IEEE 1788-2015 Section 8.3
function Sgn (Right : T) return Sign
Returns sign of a number
The number to test
Sign indicator (-1,0,1) @see IEEE 1788-2015 Section 8.3
subtype Sign is Integer range -1 .. 1;
Sign indicator for numbers -1 for negative, 0 for zero, 1 for positive
type T is delta <>;
The underlying numeric type for interval bounds Must be a fixed or numeric type supporting exact arithmetic @see IEEE 1788-2015 Section 7.2 "computational data types"
type TElements is array (Integer range <>) of T;
Array of numbers for bulk operations Used for operations on multiple numbers @see IEEE 1788-2015 Section 6.2 "interval types"
function To_Interval (Right : T) return Interval
Creates a degenerate interval [x,x]
The value to enclose
An interval containing only Right @see IEEE 1788-2015 Section 6.3 "interval literals"
function To_Interval (Lower_Bound, Upper_Bound : T) return Interval
Creates an interval from explicit bounds
The lower bound
The upper bound
Interval [Lower_Bound,Upper_Bound] @pre Lower_Bound <= Upper_Bound @see IEEE 1788-2015 Section 6.3 "interval literals"
function To_String (Right : Interval) return String
Converts interval to string representation
The interval to convert
String in format "[lower,upper]" @see IEEE 1788-2015 Section 6.3 "interval literals"