blob: 7e6d113337c7f89be821ebc86bb6505ca561dd77 [file] [log] [blame]
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Integer</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="EnumerationLiteral.html" title="EnumerationLiteral">
<link rel="next" href="Map.html" title="Map(K, V)">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<h1 xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0">
Integer
</h1>
<div class="section" title="Integer">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both">
<a name="Integer"></a>
<span class="bold"><strong>
<code class="code">Integer</code>
</strong></span>
</h2>
</div>
</div>
</div>
<p>The standard type Integer represents the mathematical concept of integer.
Integer is itself an instance of the metatype PrimitiveType (from UML).</p>
<p>conformsTo
<a class="link" href="Real.html" title="Real">
<code class="code">Real</code>
</a>
</p>
<p>
<span class="bold"><strong>Operations</strong></span>
</p>
<p>
<code class="code">*(i : OclSelf[?]) : Integer[1]</code>
precedence:
<code class="code">MULTIPLICATIVE</code>
</p>
<p>The value of the multiplication of
<code class="code">self</code> and i.
</p>
<p>
<code class="code">+(i : OclSelf[?]) : Integer[1]</code>
precedence:
<code class="code">ADDITIVE</code>
</p>
<p>The value of the addition of
<code class="code">self</code> and i.
</p>
<p>
<code class="code">-() : Integer[1]</code>
precedence:
<code class="code">UNARY</code>
</p>
<p>The negative value of
<code class="code">self</code>.
</p>
<p>
<code class="code">-(i : OclSelf[?]) : Integer[1]</code>
precedence:
<code class="code">ADDITIVE</code>
</p>
<p>The value of the subtraction of i from
<code class="code">self</code>.
</p>
<p>
<code class="code">/(i : OclSelf[?]) : Real[1]</code>
precedence:
<code class="code">MULTIPLICATIVE</code>
</p>
<p>The value of
<code class="code">self</code> divided by i.
Evaluates to
<code class="code">invalid</code> if r is equal to zero.
</p>
<p>
<code class="code">abs() : Integer[1]</code>
</p>
<p>The absolute value of
<code class="code">self</code>.
</p>
<p>
<code class="code">div(i : Integer[?]) : Integer[1]</code>
</p>
<p>The number of times that i fits completely within
<code class="code">self</code>.
</p>
<p>
<code class="code">max(i : OclSelf[?]) : Integer[1]</code>
</p>
<p>The maximum of
<code class="code">self</code> an i.
</p>
<p>
<code class="code">min(i : OclSelf[?]) : Integer[1]</code>
</p>
<p>The minimum of
<code class="code">self</code> an i.
</p>
<p>
<code class="code">mod(i : Integer[?]) : Integer[1]</code>
</p>
<p>The result is
<code class="code">self</code> modulo i.
</p>
<p>
<code class="code">toString() : String[1]</code>
</p>
<p>Converts
<code class="code">self</code> to a string value.
</p>
<p>
<code class="code">toUnlimitedNatural() : UnlimitedNatural[1]</code>
</p>
<p>Converts a non-negative
<code class="code">self</code> to an UnlimitedNatural value. A negative
<code class="code">self</code> is converted to
<code class="code">invalid</code>.
An automatic coersion may be synthesized if the coercion enables an operation reference to be resolved
in an expression where no operation was available without coercion.
</p>
</div>
</body>
</html>