Logo GenPRES

MinMaxCalculator Module

Calculates the minimum and the maximum of the product, quotient, sum or difference of two ranges from the limits and signs of both ranges. Raises a DivideByZeroException for a division by a range with zero as an inclusive limit. For example, <1N..3N] * <4N..5N> = <4N..15N>, where an angle bracket marks an exclusive limit and a square bracket an inclusive limit.

Functions and values

Function or value Description

addition (arg1, arg1) (arg2, arg2) (arg3, arg3) (arg4, arg4)

Full Usage: addition (arg1, arg1) (arg2, arg2) (arg3, arg3) (arg4, arg4)

Parameters:
Returns: Minimum option * Maximum option

Calculate Minimum option and Maximum option for addition of (min1, max1) and (min2, max2)

arg0 : ValueUnit option
arg1 : bool
arg2 : ValueUnit option
arg3 : bool
arg4 : ValueUnit option
arg5 : bool
arg6 : ValueUnit option
arg7 : bool
Returns: Minimum option * Maximum option

calc c op (arg3, arg3) (arg4, arg4)

Full Usage: calc c op (arg3, arg3) (arg4, arg4)

Parameters:
Returns: 'a option
Type parameters: 'a

Calculate x1 and x2 with operator op and use incl1 and inc2 to determine whether the result is inclusive. Use constructor c to create the optional result.

c : bool -> ValueUnit -> 'a
op : ValueUnit -> ValueUnit -> ValueUnit
arg2 : ValueUnit option
arg3 : bool
arg4 : ValueUnit option
arg5 : bool
Returns: 'a option

calcMax

Full Usage: calcMax

Returns: (ValueUnit -> ValueUnit -> ValueUnit) -> ValueUnit option * bool -> ValueUnit option * bool -> Maximum option

Calculate an optional Maximum

Returns: (ValueUnit -> ValueUnit -> ValueUnit) -> ValueUnit option * bool -> ValueUnit option * bool -> Maximum option

calcMin

Full Usage: calcMin

Returns: (ValueUnit -> ValueUnit -> ValueUnit) -> ValueUnit option * bool -> ValueUnit option * bool -> Minimum option

Calculate an optional Minimum

Returns: (ValueUnit -> ValueUnit -> ValueUnit) -> ValueUnit option * bool -> ValueUnit option * bool -> Minimum option

calcMinMax op

Full Usage: calcMinMax op

Parameters:
Returns: ValueUnit option * bool -> ValueUnit option * bool -> ValueUnit option * bool -> ValueUnit option * bool -> Minimum option * Maximum option

Match the right minmax calculation according to the operand

op : ValueUnit -> ValueUnit -> ValueUnit
Returns: ValueUnit option * bool -> ValueUnit option * bool -> ValueUnit option * bool -> ValueUnit option * bool -> Minimum option * Maximum option

division (arg1, arg1) (arg2, arg2) (arg3, arg3) (arg4, arg4)

Full Usage: division (arg1, arg1) (arg2, arg2) (arg3, arg3) (arg4, arg4)

Parameters:
Returns: Minimum option * Maximum option

Calculate Minimum option and Maximum option for division of (min1, max1) and (min2, max2)

arg0 : ValueUnit option
arg1 : bool
arg2 : ValueUnit option
arg3 : bool
arg4 : ValueUnit option
arg5 : bool
arg6 : ValueUnit option
arg7 : bool
Returns: Minimum option * Maximum option

maximize max1 max2

Full Usage: maximize max1 max2

Parameters:
Returns: Maximum option

get the largest maximum

max1 : Maximum option
max2 : Maximum option
Returns: Maximum option

minimize min1 min2

Full Usage: minimize min1 min2

Parameters:
Returns: Minimum option

get the smallest minimum

min1 : Minimum option
min2 : Minimum option
Returns: Minimum option

multiplication (arg1, arg1) (arg2, arg2) (arg3, arg3) (arg4, arg4)

Full Usage: multiplication (arg1, arg1) (arg2, arg2) (arg3, arg3) (arg4, arg4)

Parameters:
Returns: Minimum option * Maximum option

Calculate Minimum option and Maximum option for multiplication of (min1, max1) and (min2, max2)

arg0 : ValueUnit option
arg1 : bool
arg2 : ValueUnit option
arg3 : bool
arg4 : ValueUnit option
arg5 : bool
arg6 : ValueUnit option
arg7 : bool
Returns: Minimum option * Maximum option

subtraction (arg1, arg1) (arg2, arg2) (arg3, arg3) (arg4, arg4)

Full Usage: subtraction (arg1, arg1) (arg2, arg2) (arg3, arg3) (arg4, arg4)

Parameters:
Returns: Minimum option * Maximum option

Calculate Minimum option and Maximum option for subtraction of (min1, max1) and (min2, max2)

arg0 : ValueUnit option
arg1 : bool
arg2 : ValueUnit option
arg3 : bool
arg4 : ValueUnit option
arg5 : bool
arg6 : ValueUnit option
arg7 : bool
Returns: Minimum option * Maximum option

Active patterns

Active pattern Description

(|PP|NN|NP|NZ|ZP|) (min, max)

Full Usage: (|PP|NN|NP|NZ|ZP|) (min, max)

Parameters:
Returns: Choice<unit, unit, unit, unit, unit>

Match a min, max tuple min, max to: * PP: both positive * NN: both negative * NP: one negative, the other positive

min : ValueUnit option
max : ValueUnit option
Returns: Choice<unit, unit, unit, unit, unit>

Type something to start searching.