Ieee1788

Entities

Generic formal parameters

Exceptions

Array Types

Record Types

Subtypes

Subprograms

Description

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

Parameters
Left

First interval operand

Right

Second interval operand

Return Value

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)

Parameters
Right

The interval to operate on

Return Value

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

Parameters
Left

First interval operand

Right

Second interval operand

Return Value

[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)

Parameters
Right

The interval to negate

Return Value

[-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

Parameters
Left

First interval operand

Right

Second interval operand

Return Value

[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

Parameters
Left

First interval operand

Right

Second interval operand

Return Value

Result based on sign combinations of operands

Raised exceptions
Invalid_Arguments_To_Division

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

Parameters
Left

First interval

Right

Second interval

Return Value

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

Parameters
Left

First interval

Right

Second interval

Return Value

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

Parameters
Left

First interval

Right

Second interval

Return Value

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

Parameters
Left

First interval

Right

Second interval

Return Value

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

Parameters
Left

First interval

Right

Second interval

Return Value

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"

"abs"

function "abs" (Right : Interval) return Interval

Returns the absolute value of an interval

Parameters
Right

The interval to take the absolute value of

Return Value

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"

Entire

function Entire return Interval

Returns an interval containing all representable values Creates an interval spanning the entire range of type T

Return Value

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"

Hull

function Hull (Left, Right : Interval) return Interval

Computes interval hull of two intervals

Parameters
Left

First interval

Right

Second interval

Return Value

Smallest interval containing both inputs @see IEEE 1788-2015 Section 6.4 "interval hulls"

Hull

function Hull (Right : IntervalElements) return Interval

Computes hull of interval array

Parameters
Right

Array of intervals

Return Value

Smallest interval containing all inputs @see IEEE 1788-2015 Section 6.4 "interval hulls"

Hull

function Hull (Left, Right : T) return Interval

Computes interval hull of two numbers

Parameters
Left

First number

Right

Second number

Return Value

Smallest interval containing both inputs @see IEEE 1788-2015 Section 6.4 "interval hulls"

Hull

function Hull (Right : TElements) return Interval

Computes hull of number array

Parameters
Right

Array of numbers

Return Value

Smallest interval containing all inputs @see IEEE 1788-2015 Section 6.4 "interval hulls"

Interval

type Interval is record
   Lower_Bound : T;
   Upper_Bound : T;
end record;

Internal interval representation Stores bounds with invariant Lower_Bound <= Upper_Bound

Record fields
Lower_Bound

Lower bound of interval

Upper_Bound

Upper bound of interval

IntervalElements

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

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"

Max

function Max (Left, Right : T) return T

Returns maximum of two numbers

Parameters
Left

First number

Right

Second number

Return Value

The larger value @see IEEE 1788-2015 Section 8.3

Min

function Min (Left, Right : T) return T

Returns minimum of two numbers

Parameters
Left

First number

Right

Second number

Return Value

The smaller value @see IEEE 1788-2015 Section 8.3

Sgn

function Sgn (Right : T) return Sign

Returns sign of a number

Parameters
Right

The number to test

Return Value

Sign indicator (-1,0,1) @see IEEE 1788-2015 Section 8.3

Sign

subtype Sign is Integer range -1 .. 1;

Sign indicator for numbers -1 for negative, 0 for zero, 1 for positive

T

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"

TElements

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"

To_Interval

function To_Interval (Right : T) return Interval

Creates a degenerate interval [x,x]

Parameters
Right

The value to enclose

Return Value

An interval containing only Right @see IEEE 1788-2015 Section 6.3 "interval literals"

To_Interval

function To_Interval (Lower_Bound, Upper_Bound : T) return Interval

Creates an interval from explicit bounds

Parameters
Lower_Bound

The lower bound

Upper_Bound

The upper bound

Return Value

Interval [Lower_Bound,Upper_Bound] @pre Lower_Bound <= Upper_Bound @see IEEE 1788-2015 Section 6.3 "interval literals"

To_String

function To_String (Right : Interval) return String

Converts interval to string representation

Parameters
Right

The interval to convert

Return Value

String in format "[lower,upper]" @see IEEE 1788-2015 Section 6.3 "interval literals"