/usr/share/mozart/doc/base/int.html is in mozart-doc 1.4.0-8ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>4.2 Integers</TITLE><LINK href="ozdoc.css" rel="stylesheet" type="text/css"></HEAD><BODY><TABLE align="center" border="0" cellpadding="6" cellspacing="6" class="nav"><TR bgcolor="#DDDDDD"><TD><A href="number.html#section.numbers.general"><< Prev</A></TD><TD><A href="node6.html">- Up -</A></TD><TD><A href="float.html#section.numbers.floats">Next >></A></TD></TR></TABLE><DIV id="section.numbers.integers"><H2><A name="section.numbers.integers">4.2 Integers</A></H2><P> The module <A name="label68"></A><SPAN class="index"><CODE>Int</CODE></SPAN> contains procedures operating on integers. </P><DL><DT><A name="label69"></A><SPAN class="index"><CODE>IsInt</CODE></SPAN> <A name="label71"></A> </DT><DD><BLOCKQUOTE class="synopsis"><P><CODE>{Int<SPAN class="keyword">.</SPAN>is </CODE><CODE>+<I>X</I></CODE><CODE> </CODE><CODE>?<I>B</I></CODE><CODE>}</CODE> </P></BLOCKQUOTE></DD><DD><P>tests whether <CODE><I>X</I></CODE> is an integer. </P></DD><DT><A name="label72"></A><SPAN class="index"><CODE>IsNat</CODE></SPAN> <A name="label73"></A> </DT><DD><BLOCKQUOTE class="synopsis"><P><CODE>{Int<SPAN class="keyword">.</SPAN>isNat </CODE><CODE>+<I>I</I></CODE><CODE> </CODE><CODE>?<I>B</I></CODE><CODE>}</CODE> </P></BLOCKQUOTE></DD><DD><P>tests whether <CODE><I>I</I></CODE> is a natural number, i. e., an integer greater than or equal to <CODE>0</CODE>. </P></DD><DT><A name="label74"></A><SPAN class="index"><CODE>IsOdd</CODE></SPAN> <A name="label75"></A> </DT><DD><BLOCKQUOTE class="synopsis"><P><CODE>{Int<SPAN class="keyword">.</SPAN>isOdd </CODE><CODE>+<I>I</I></CODE><CODE> </CODE><CODE>?<I>B</I></CODE><CODE>}</CODE> </P></BLOCKQUOTE></DD><DD><P>tests whether <CODE><I>I</I></CODE> is an odd integer. </P></DD><DT><A name="label76"></A><SPAN class="index"><CODE>IsEven</CODE></SPAN> <A name="label77"></A> </DT><DD><BLOCKQUOTE class="synopsis"><P><CODE>{Int<SPAN class="keyword">.</SPAN>isEven </CODE><CODE>+<I>I</I></CODE><CODE> </CODE><CODE>?<I>B</I></CODE><CODE>}</CODE> </P></BLOCKQUOTE></DD><DD><P>tests whether <CODE><I>I</I></CODE> is an even integer. </P></DD><DT><A name="label78"></A><SPAN class="index"><CODE><SPAN class="keyword">div</SPAN></CODE></SPAN> <A name="label79"></A> </DT><DD><BLOCKQUOTE class="synopsis"><P><CODE>{Int<SPAN class="keyword">.</SPAN><SPAN class="string">'div'</SPAN> </CODE><CODE>+<I>I1</I></CODE><CODE> </CODE><CODE>+<I>I2</I></CODE><CODE> </CODE><CODE>?<I>I3</I></CODE><CODE>}</CODE> </P></BLOCKQUOTE></DD><DD><P>returns <CODE><I>I1</I></CODE> integer-divided by <CODE><I>I2</I></CODE>, rounding towards <CODE>0</CODE>. <CODE>Int<SPAN class="keyword">.</SPAN><SPAN class="string">'div'</SPAN></CODE> can be defined as follows: </P><BLOCKQUOTE class="code"><CODE><SPAN class="keyword">local</SPAN> <BR> <SPAN class="keyword">fun</SPAN><SPAN class="variablename"> </SPAN>{<SPAN class="functionname">Div</SPAN> I1 I2}<BR> <SPAN class="keyword">case</SPAN> I1 <SPAN class="keyword"><</SPAN> I2 <SPAN class="keyword">then</SPAN> 0 <SPAN class="keyword">else</SPAN> 1 <SPAN class="keyword">+</SPAN> {Div I1 <SPAN class="keyword">-</SPAN> I2 I2} <SPAN class="keyword">end</SPAN> <BR> <SPAN class="keyword">end</SPAN> <BR><SPAN class="keyword">in</SPAN> <BR> <SPAN class="keyword">fun</SPAN><SPAN class="variablename"> </SPAN>{<SPAN class="functionname">Int.</SPAN><SPAN class="string">'div'</SPAN> I1 I2}<BR> {Div {Abs I1} {Abs I2}} <SPAN class="keyword">*</SPAN> <BR> <SPAN class="keyword">case</SPAN> I1 <SPAN class="keyword">*</SPAN> I2 <SPAN class="keyword">>=</SPAN> 0 <SPAN class="keyword">then</SPAN> 1 <SPAN class="keyword">else</SPAN> <SPAN class="keyword">~</SPAN>1 <SPAN class="keyword">end</SPAN> <BR> <SPAN class="keyword">end</SPAN> <BR><SPAN class="keyword">end</SPAN></CODE></BLOCKQUOTE><P> </P></DD><DT><A name="label80"></A><SPAN class="index"><CODE><SPAN class="keyword">mod</SPAN></CODE></SPAN> <A name="label81"></A> </DT><DD><BLOCKQUOTE class="synopsis"><P><CODE>{Int<SPAN class="keyword">.</SPAN><SPAN class="string">'mod'</SPAN> </CODE><CODE>+<I>I1</I></CODE><CODE> </CODE><CODE>+<I>I2</I></CODE><CODE> </CODE><CODE>?<I>I3</I></CODE><CODE>}</CODE> </P></BLOCKQUOTE></DD><DD><P>returns <CODE><I>I1</I></CODE> modulo <CODE><I>I2</I></CODE>. <CODE>Int<SPAN class="keyword">.</SPAN><SPAN class="string">'mod'</SPAN></CODE> can be defined as follows: </P><BLOCKQUOTE class="code"><CODE><SPAN class="keyword">fun</SPAN><SPAN class="variablename"> </SPAN>{<SPAN class="functionname">Int.</SPAN><SPAN class="string">'mod'</SPAN> I1 I2}<BR> I1 <SPAN class="keyword">-</SPAN> I2 <SPAN class="keyword">*</SPAN> (I1 <SPAN class="keyword">div</SPAN> I2)<BR><SPAN class="keyword">end</SPAN></CODE></BLOCKQUOTE><P> </P></DD><DT><A name="label82"></A><SPAN class="index"><CODE>IntToFloat</CODE></SPAN> <A name="label84"></A> </DT><DD><BLOCKQUOTE class="synopsis"><P><CODE>{Int<SPAN class="keyword">.</SPAN>toFloat </CODE><CODE>+<I>I</I></CODE><CODE> </CODE><CODE>?<I>F</I></CODE><CODE>}</CODE> </P></BLOCKQUOTE></DD><DD><P>returns the float closest to the integer <CODE><I>I</I></CODE>. </P></DD><DT><A name="label85"></A><SPAN class="index"><CODE>IntToString</CODE></SPAN> <A name="label87"></A> </DT><DD><BLOCKQUOTE class="synopsis"><P><CODE>{Int<SPAN class="keyword">.</SPAN>toString </CODE><CODE>+<I>I</I></CODE><CODE> </CODE><CODE>?<I>S</I></CODE><CODE>}</CODE> </P></BLOCKQUOTE></DD><DD><P>returns the string describing the integer <CODE><I>I</I></CODE> in Oz concrete syntax. </P></DD></DL><P> </P></DIV><TABLE align="center" border="0" cellpadding="6" cellspacing="6" class="nav"><TR bgcolor="#DDDDDD"><TD><A href="number.html#section.numbers.general"><< Prev</A></TD><TD><A href="node6.html">- Up -</A></TD><TD><A href="float.html#section.numbers.floats">Next >></A></TD></TR></TABLE><HR><ADDRESS><A href="http://www.ps.uni-sb.de/~duchier/">Denys Duchier</A>, <A href="http://www.ps.uni-sb.de/~kornstae/">Leif Kornstaedt</A> and <A href="http://www.ps.uni-sb.de/~schulte/">Christian Schulte</A><BR><SPAN class="version">Version 1.4.0 (20110908185330)</SPAN></ADDRESS></BODY></HTML>
|