RealAssertions
Short summary
This class provides assert statements for 32 bit floatings (REAL).
It implements the interface IRealAssertions
| Access | Abstract | Final | Extends | Implements |
|---|---|---|---|---|
| INTERNAL | No | No | AbstractAssertion | IRealAssertions |
UML Diagram
Parameters
none
Properties
className
Type: CNM_AbstractObject.ClassName
This abstract property returns the class name of the concrete object, …
Methods
isValueInfinite
- Parameters:
value(REAL): value to check
- Return type:
BOOL
This method checks if a value is infinite…
isValueNaN
- Parameters:
value(REAL): value to check
- Return type:
BOOL
This method checks if a value is not a number…
isValueNegativeInfinite
- Parameters:
value(REAL): value to check
- Return type:
BOOL
This method checks if a value is negative infinite…
isValuePositiveInfinite
- Parameters:
value(REAL): value to check
- Return type:
BOOL
This method checks if a value is positive infinite…
isValueSpecial
- Parameters:
value(REAL): value to check
- Return type:
BOOL
This method checks if a value is a special value…
valueIsANumber
- Parameters:
currentValue(REAL): current value to checkmessage(AssertMessage): message if the assertion is false
- Return type:
VOID
This assertion method checks if the current value is a number (NOT NaN)…
valueIsEqualTo
- Parameters:
currentValue(REAL): current value to checkexpectedValue(REAL): expected value to comparetolerance(REAL): tolerance to compensate twiddling floats, it has no signmessage(AssertMessage): message if the assertion is false
- Return type:
VOID
This assertion method checks if the current value is equal to the expected value…
valueIsFinite
- Parameters:
currentValue(REAL): current value to checkmessage(AssertMessage): message if the assertion is false
- Return type:
VOID
This assertion method checks if the current value is finite…
valueIsGreaterThan
- Parameters:
currentValue(REAL): current value to checklessValue(REAL): less than lower limitmessage(AssertMessage): message if the assertion is false
- Return type:
VOID
This assertion method checks if the current value is greater than the less value…
valueIsInfinite
- Parameters:
currentValue(REAL): current value to checkmessage(AssertMessage): message if the assertion is false
- Return type:
VOID
This assertion method checks if the current value is infinite…
valueIsInRangeOf
- Parameters:
lowerLimit(REAL): lower limit for the current valuecurrentValue(REAL): current value to checkupperLimit(REAL): upper limit for the current valuemessage(AssertMessage): message if the assertion is false
- Return type:
VOID
This assertion method checks if the current value is inside a limit…
valueIsLessThan
- Parameters:
currentValue(REAL): current value to checkgreaterValue(REAL): greater than upper limitmessage(AssertMessage): message if the assertion is false
- Return type:
VOID
This assertion method checks if the current value is greater than the less value…
valueIsMax
- Parameters:
currentValue(REAL): current value to checkmaximumValue(REAL): upper limit for the current valuemessage(AssertMessage): message if the assertion is false
- Return type:
VOID
This assertion method checks if the current value is less than or equal to the maximum value…
valueIsMin
- Parameters:
currentValue(REAL): current value to checkminimumValue(REAL): lower limit for the current valuemessage(AssertMessage): message if the assertion is false
- Return type:
VOID
This assertion method checks if the current value is greater than or equal to the minimum value…
valueIsNaN
- Parameters:
currentValue(REAL): current value to checkmessage(AssertMessage): message if the assertion is false
- Return type:
VOID
This assertion method checks if the current value is a not a number (NaN)…
valueIsNegative
- Parameters:
currentValue(REAL): current value to checkmessage(AssertMessage): message if the assertion is false
- Return type:
VOID
This assertion method checks if the current value is negative…
valueIsNegativeInfinite
- Parameters:
currentValue(REAL): current value to checkmessage(AssertMessage): message if the assertion is false
- Return type:
VOID
This assertion method checks if the current value is negative infinite…
valueIsNegativeZero
- Parameters:
currentValue(REAL): current value to checkmessage(AssertMessage): message if the assertion is false
- Return type:
VOID
This assertion method checks if the current value is -0.0…
valueIsNormal
- Parameters:
currentValue(REAL): current value to checkmessage(AssertMessage): message if the assertion is false
- Return type:
VOID
This assertion method checks if the current value is a normal number…
valueIsNotEqualTo
- Parameters:
currentValue(REAL): current value to checkunexpectedValue(REAL): unexpected value to comparetolerance(REAL): tolerance to compensate twiddling floats, it has no signmessage(AssertMessage): message if the assertion is false
- Return type:
VOID
This assertion method checks if the current value is not equal to the unexpected value…
valueIsNotNegativeInfinite
- Parameters:
currentValue(REAL): current value to checkmessage(AssertMessage): message if the assertion is false
- Return type:
VOID
This assertion method checks if the current value is not negative infinite…
valueIsNotPositiveInfinite
- Parameters:
currentValue(REAL): current value to checkmessage(AssertMessage): message if the assertion is false
- Return type:
VOID
This assertion method checks if the current value is not positive infinite…
valueIsNotSpecial
- Parameters:
currentValue(REAL): current value to checkmessage(AssertMessage): message if the assertion is false
- Return type:
VOID
This assertion method checks if the current value is a non special number…
valueIsPositive
- Parameters:
currentValue(REAL): current value to checkmessage(AssertMessage): message if the assertion is false
- Return type:
VOID
This assertion method checks if the current value is positve…
valueIsPositiveInfinite
- Parameters:
currentValue(REAL): current value to checkmessage(AssertMessage): message if the assertion is false
- Return type:
VOID
This assertion method checks if the current value is positive infinite…
valueIsPositiveZero
- Parameters:
currentValue(REAL): current value to checkmessage(AssertMessage): message if the assertion is false
- Return type:
VOID
This assertion method checks if the current value is +0.0…
valueIsSpecial
- Parameters:
currentValue(REAL): current value to checkmessage(AssertMessage): message if the assertion is false
- Return type:
VOID
This assertion method checks if the current value is a special…
valueIsSubnormal
- Parameters:
currentValue(REAL): current value to checkmessage(AssertMessage): message if the assertion is false
- Return type:
VOID
This assertion method checks if the current value is a subnormal number…
Code
Declaration
{attribute 'reflection'}
FUNCTION_BLOCK INTERNAL RealAssertions EXTENDS AbstractAssertion IMPLEMENTS IRealAssertions
VAR
END_VAR
VAR CONSTANT
(* mask for determining value as a special value *)
MASK_FOR_EXPONENT :DWORD := 16#7F80_0000;
(* mask for determining a special value as NaN or infinite *)
MASK_FOR_FRACTION :DWORD := 16#007F_FFFF;
(* mask to get the sign bit of an infinite or zero value *)
MASK_FOR_SIGN_BIT :DWORD := 16#8000_0000;
(* just to compare results or the memory of a float value *)
ZERO :DWORD := 16#0000_0000;
END_VAR