The standard type Real represents the mathematical concept of real. Note that UnlimitedNatural is a subclass of Integer and that Integer is a subclass of Real, so for each parameter of type Real, you can use an unlimited natural or an integer as the actual parameter. Real is itself an instance of the metatype PrimitiveType (from UML).
conformsTo
OclComparable
,
OclSummable
Operations
=(object2 : OclSelf) : Boolean
precedence:
EQUALITY
Returns
true
if the numeric value of
self
is the same as the numeric value of object2,
false
otherwise.
<>(object2 : OclSelf) : Boolean
precedence:
EQUALITY
Returns
true
if the numeric value of
self
is the not the same as the numeric value of object2,
false
otherwise.
+(r : OclSelf) : Real
precedence:
ADDITIVE
The value of the addition of
self
and r.
-(r : OclSelf) : Real
precedence:
ADDITIVE
The value of the subtraction of r from
self
.
*(r : OclSelf) : Real
precedence:
MULTIPLICATIVE
The value of the multiplication of
self
and r.
-() : Real
precedence:
UNARY
The negative value of
self
.
/(r : OclSelf) : Real
precedence:
MULTIPLICATIVE
The value of
self
divided by r. Evaluates to
invalid
if r is equal to zero.
>(r : OclSelf) : Boolean
precedence:
RELATIONAL
True if
self
is greater than r.
<(r : OclSelf) : Boolean
precedence:
RELATIONAL
True if
self
is less than r.
<=(r : OclSelf) : Boolean
precedence:
RELATIONAL
True if
self
is less than or equal to r.
>=(r : OclSelf) : Boolean
precedence:
RELATIONAL
True if
self
is greater than or equal to r.
abs() : Real
The absolute value of
self
.
compareTo(that : OclSelf) : Integer
The comparison of
self
with
that
. -ve if less than, 0 if equal, +ve if greater than.
floor() : Integer
The largest integer that is less than or equal to
self
.
max(r : OclSelf) : Real
The maximum of
self
and r.
min(r : OclSelf) : Real
The minimum of
self
and r.
round() : Integer
The integer that is closest to
self
. When there are two such integers, the largest one.
toString() : String
Converts
self
to a string value.