blob: 86ea335e22162d46850b85e68e43d17d91a061f1 [file] [log] [blame]
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Real</title>
<link href="book.css" rel="stylesheet" type="text/css">
<meta content="DocBook XSL Stylesheets V1.75.1" name="generator">
<link rel="home" href="index.html" title="OCL Documentation">
<link rel="up" href="StandardLibrary.html" title="The OCL Standard Library">
<link rel="prev" href="OrderedSet.html" title="OrderedSet(T)">
<link rel="next" href="Sequence.html" title="Sequence(T)">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<h1 xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0">
Real
</h1>
<div class="section" title="Real">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both">
<a name="Real"></a>
<span class="bold"><strong>
<code class="code">Real</code>
</strong></span>
</h2>
</div>
</div>
</div>
<p>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).</p>
<p>conformsTo
<a class="link" href="OclComparable.html" title="OclComparable">
<code class="code">OclComparable</code>
</a>,
<a class="link" href="OclSummable.html" title="OclSummable">
<code class="code">OclSummable</code>
</a>
</p>
<p>
<span class="bold"><strong>Operations</strong></span>
</p>
<p>
<code class="code">=(object2 : OclSelf) : Boolean</code>
precedence:
<code class="code">EQUALITY</code>
</p>
<p>Returns
<code class="code">true</code> if the numeric value of
<code class="code">self</code> is the same as the numeric value of object2,
<code class="code">false</code> otherwise.
</p>
<p>
<code class="code">&lt;&gt;(object2 : OclSelf) : Boolean</code>
precedence:
<code class="code">EQUALITY</code>
</p>
<p>Returns
<code class="code">true</code> if the numeric value of
<code class="code">self</code> is the not the same as the numeric value of object2,
<code class="code">false</code> otherwise.
</p>
<p>
<code class="code">+(r : OclSelf) : Real</code>
precedence:
<code class="code">ADDITIVE</code>
</p>
<p>The value of the addition of
<code class="code">self</code> and r.
</p>
<p>
<code class="code">-(r : OclSelf) : Real</code>
precedence:
<code class="code">ADDITIVE</code>
</p>
<p>The value of the subtraction of r from
<code class="code">self</code>.
</p>
<p>
<code class="code">*(r : OclSelf) : Real</code>
precedence:
<code class="code">MULTIPLICATIVE</code>
</p>
<p>The value of the multiplication of
<code class="code">self</code> and r.
</p>
<p>
<code class="code">-() : Real</code>
precedence:
<code class="code">UNARY</code>
</p>
<p>The negative value of
<code class="code">self</code>.
</p>
<p>
<code class="code">/(r : OclSelf) : Real</code>
precedence:
<code class="code">MULTIPLICATIVE</code>
</p>
<p>The value of
<code class="code">self</code> divided by r. Evaluates to
<code class="code">invalid</code> if r is equal to zero.
</p>
<p>
<code class="code">&gt;(r : OclSelf) : Boolean</code>
precedence:
<code class="code">RELATIONAL</code>
</p>
<p>True if
<code class="code">self</code> is greater than r.
</p>
<p>
<code class="code">&lt;(r : OclSelf) : Boolean</code>
precedence:
<code class="code">RELATIONAL</code>
</p>
<p>True if
<code class="code">self</code> is less than r.
</p>
<p>
<code class="code">&lt;=(r : OclSelf) : Boolean</code>
precedence:
<code class="code">RELATIONAL</code>
</p>
<p>True if
<code class="code">self</code> is less than or equal to r.
</p>
<p>
<code class="code">&gt;=(r : OclSelf) : Boolean</code>
precedence:
<code class="code">RELATIONAL</code>
</p>
<p>True if
<code class="code">self</code> is greater than or equal to r.
</p>
<p>
<code class="code">abs() : Real</code>
</p>
<p>The absolute value of
<code class="code">self</code>.
</p>
<p>
<code class="code">compareTo(that : OclSelf) : Integer</code>
</p>
<p>The comparison of
<code class="code">self</code> with
<code class="code">that</code>. -ve if less than, 0 if equal, +ve if greater than.
</p>
<p>
<code class="code">floor() : Integer</code>
</p>
<p>The largest integer that is less than or equal to
<code class="code">self</code>.
</p>
<p>
<code class="code">max(r : OclSelf) : Real</code>
</p>
<p>The maximum of
<code class="code">self</code> and r.
</p>
<p>
<code class="code">min(r : OclSelf) : Real</code>
</p>
<p>The minimum of
<code class="code">self</code> and r.
</p>
<p>
<code class="code">round() : Integer</code>
</p>
<p>The integer that is closest to
<code class="code">self</code>. When there are two such integers, the largest one.
</p>
<p>
<code class="code">toString() : String</code>
</p>
<p>Converts
<code class="code">self</code> to a string value.
</p>
</div>
</body>
</html>