~ubuntu-branches/ubuntu/hardy/ocaml-doc/hardy

« back to all changes in this revision

Viewing changes to ocaml.html/libref/Pervasives.html

  • Committer: Bazaar Package Importer
  • Author(s): Samuel Mimram
  • Date: 2007-09-08 01:49:22 UTC
  • mfrom: (0.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20070908014922-lvihyehz0ndq7suu
Tags: 3.10-1
* New upstream release.
* Removed camlp4 documentation since it is not up-to-date.
* Updated to standards version 3.7.2, no changes needed.
* Updated my email address.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
1
2
<html>
2
3
<head>
3
4
<link rel="stylesheet" href="style.css" type="text/css">
 
5
<meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type">
4
6
<link rel="Start" href="index.html">
5
7
<link rel="previous" href="Parsing.html">
6
8
<link rel="next" href="Printexc.html">
66
68
<link title="Sys" rel="Chapter" href="Sys.html">
67
69
<link title="Thread" rel="Chapter" href="Thread.html">
68
70
<link title="ThreadUnix" rel="Chapter" href="ThreadUnix.html">
 
71
<link title="Tk" rel="Chapter" href="Tk.html">
69
72
<link title="Unix" rel="Chapter" href="Unix.html">
70
73
<link title="UnixLabels" rel="Chapter" href="UnixLabels.html">
71
74
<link title="Weak" rel="Chapter" href="Weak.html"><link title="Exceptions" rel="Section" href="#6_Exceptions">
139
142
   Equality between functional values raises <code class="code"><span class="constructor">Invalid_argument</span></code>.
140
143
   Equality between cyclic data structures does not terminate.<br>
141
144
</div>
142
 
<pre><span class="keyword">val</span> <a name="VAL(<>)"></a>(<>) : <code class="type">'a -> 'a -> bool</code></pre><div class="info">
 
145
<pre><span class="keyword">val</span> <a name="VAL(<>)"></a>(&lt;&gt;) : <code class="type">'a -> 'a -> bool</code></pre><div class="info">
143
146
Negation of <a href="Pervasives.html#VAL(=)"><code class="code">(=)</code></a>.<br>
144
147
</div>
145
 
<pre><span class="keyword">val</span> <a name="VAL(<)"></a>(<) : <code class="type">'a -> 'a -> bool</code></pre><div class="info">
146
 
See <a href="Pervasives.html#VAL(>=)"><code class="code">(&gt;=)</code></a>.<br>
147
 
</div>
148
 
<pre><span class="keyword">val</span> <a name="VAL(>)"></a>(>) : <code class="type">'a -> 'a -> bool</code></pre><div class="info">
149
 
See <a href="Pervasives.html#VAL(>=)"><code class="code">(&gt;=)</code></a>.<br>
150
 
</div>
151
 
<pre><span class="keyword">val</span> <a name="VAL(<=)"></a>(<=) : <code class="type">'a -> 'a -> bool</code></pre><div class="info">
152
 
See <a href="Pervasives.html#VAL(>=)"><code class="code">(&gt;=)</code></a>.<br>
153
 
</div>
154
 
<pre><span class="keyword">val</span> <a name="VAL(>=)"></a>(>=) : <code class="type">'a -> 'a -> bool</code></pre><div class="info">
 
148
<pre><span class="keyword">val</span> <a name="VAL(<)"></a>(&lt;) : <code class="type">'a -> 'a -> bool</code></pre><div class="info">
 
149
See <a href="Pervasives.html#VAL(>=)"><code class="code">(&gt;=)</code></a>.<br>
 
150
</div>
 
151
<pre><span class="keyword">val</span> <a name="VAL(>)"></a>(&gt;) : <code class="type">'a -> 'a -> bool</code></pre><div class="info">
 
152
See <a href="Pervasives.html#VAL(>=)"><code class="code">(&gt;=)</code></a>.<br>
 
153
</div>
 
154
<pre><span class="keyword">val</span> <a name="VAL(<=)"></a>(&lt;=) : <code class="type">'a -> 'a -> bool</code></pre><div class="info">
 
155
See <a href="Pervasives.html#VAL(>=)"><code class="code">(&gt;=)</code></a>.<br>
 
156
</div>
 
157
<pre><span class="keyword">val</span> <a name="VAL(>=)"></a>(&gt;=) : <code class="type">'a -> 'a -> bool</code></pre><div class="info">
155
158
Structural ordering functions. These functions coincide with
156
159
   the usual orderings over integers, characters, strings
157
160
   and floating-point numbers, and extend them to a
206
209
<pre><span class="keyword">val</span> <a name="VALnot"></a>not : <code class="type">bool -> bool</code></pre><div class="info">
207
210
The boolean negation.<br>
208
211
</div>
209
 
<pre><span class="keyword">val</span> <a name="VAL(&&)"></a>(&&) : <code class="type">bool -> bool -> bool</code></pre><div class="info">
 
212
<pre><span class="keyword">val</span> <a name="VAL(&&)"></a>(&amp;&amp;) : <code class="type">bool -> bool -> bool</code></pre><div class="info">
210
213
The boolean ``and''. Evaluation is sequential, left-to-right:
211
214
   in <code class="code">e1 <span class="keywordsign">&amp;&amp;</span> e2</code>, <code class="code">e1</code> is evaluated first, and if it returns <code class="code"><span class="keyword">false</span></code>,
212
215
   <code class="code">e2</code> is not evaluated at all.<br>
213
216
</div>
214
 
<pre><span class="keyword">val</span> <a name="VAL(&)"></a>(&) : <code class="type">bool -> bool -> bool</code></pre><div class="info">
 
217
<pre><span class="keyword">val</span> <a name="VAL(&)"></a>(&amp;) : <code class="type">bool -> bool -> bool</code></pre><div class="info">
215
218
<span class="warning">Deprecated.</span><a href="Pervasives.html#VAL(&&)"><code class="code">(<span class="keywordsign">&amp;&amp;</span>)</code></a> should be used instead.<br>
216
219
</div>
217
220
<pre><span class="keyword">val</span> <a name="VAL(||)"></a>(||) : <code class="type">bool -> bool -> bool</code></pre><div class="info">
261
264
   <code class="code">x = (x / y) * y + x <span class="keyword">mod</span> y</code> and
262
265
   <code class="code">abs(x <span class="keyword">mod</span> y) &lt;= abs(y)-1</code>.
263
266
   If <code class="code">y = 0</code>, <code class="code">x <span class="keyword">mod</span> y</code> raises <code class="code"><span class="constructor">Division_by_zero</span></code>.
264
 
   Notice that <code class="code">x <span class="keyword">mod</span> y</code> is negative if and only if <code class="code">x &lt; 0</code>.<br>
 
267
   Notice that <code class="code">x <span class="keyword">mod</span> y</code> is nonpositive if and only if <code class="code">x &lt; 0</code>.
 
268
   Raise <code class="code"><span class="constructor">Division_by_zero</span></code> if <code class="code">y</code> is zero.<br>
265
269
</div>
266
270
<pre><span class="keyword">val</span> <a name="VALabs"></a>abs : <code class="type">int -> int</code></pre><div class="info">
267
 
Return the absolute value of the argument.<br>
 
271
Return the absolute value of the argument.  Note that this may be
 
272
  negative if the argument is <code class="code">min_int</code>.<br>
268
273
</div>
269
274
<pre><span class="keyword">val</span> <a name="VALmax_int"></a>max_int : <code class="type">int</code></pre><div class="info">
270
275
The greatest representable integer.<br>
422
427
</div>
423
428
<pre><span class="keyword">val</span> <a name="VALint_of_float"></a>int_of_float : <code class="type">float -> int</code></pre><div class="info">
424
429
Truncate the given floating-point number to an integer.
425
 
   The result is unspecified if it falls outside the
 
430
   The result is unspecified if the argument is <code class="code">nan</code> or falls outside the
426
431
   range of representable integers.<br>
427
432
</div>
428
433
<pre><span class="keyword">val</span> <a name="VALinfinity"></a>infinity : <code class="type">float</code></pre><div class="info">
708
713
<code><span class="keyword">|</span></code></td>
709
714
<td align="left" valign="top" >
710
715
<code><span class="constructor">Open_excl</span></code></td>
711
 
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >fail if 
712
 
<span style="background-color:yellow; color:red">Open_creat and</span>
713
 
 the file already exists.</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
 
716
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >fail if Open_creat and the file already exists.</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
714
717
</tr>
715
718
<tr>
716
719
<td align="left" valign="top" >
996
999
<br>
997
1000
<a name="6_Operationsonformatstrings"></a>
998
1001
<h6>Operations on format strings</h6><br>
999
 
<br>
 
1002
<pre><span class="keyword">type</span> <a name="TYPEformat4"></a><code class="type">('a, 'b, 'c, 'd)</code> format4 = <code class="type">('a, 'b, 'c, 'c, 'c, 'd) format6</code> </pre>
 
1003
<div class="info">
1000
1004
See modules <a href="Printf.html"><code class="code"><span class="constructor">Printf</span></code></a> and <a href="Scanf.html"><code class="code"><span class="constructor">Scanf</span></code></a> for more operations on
1001
1005
    format strings.<br>
1002
 
<pre><span class="keyword">type</span> <a name="TYPEformat"></a><code class="type">('a, 'b, 'c)</code> format = <code class="type">('a, 'b, 'c, 'c) format4</code> </pre>
 
1006
</div>
 
1007
 
 
1008
<pre><span class="keyword">type</span> <a name="TYPEformat"></a><code class="type">('a, 'b, 'c)</code> format = <code class="type">('a, 'b, 'c, 'c) <a href="Pervasives.html#TYPEformat4">format4</a></code> </pre>
1003
1009
<div class="info">
1004
1010
Simplified type for format strings, included for backward compatibility
1005
1011
    with earlier releases of Objective Caml.
1009
1015
    <code class="code">%a</code> and <code class="code">%t</code> printing functions.<br>
1010
1016
</div>
1011
1017
 
1012
 
<pre><span class="keyword">val</span> <a name="VALstring_of_format"></a>string_of_format : <code class="type">('a, 'b, 'c, 'd) format4 -> string</code></pre><div class="info">
 
1018
<pre><span class="keyword">val</span> <a name="VALstring_of_format"></a>string_of_format : <code class="type">('a, 'b, 'c, 'd, 'e, 'f) format6 -> string</code></pre><div class="info">
1013
1019
Converts a format string into a string.<br>
1014
1020
</div>
1015
 
<pre><span class="keyword">val</span> <a name="VALformat_of_string"></a>format_of_string : <code class="type">('a, 'b, 'c, 'd) format4 -> ('a, 'b, 'c, 'd) format4</code></pre><div class="info">
 
1021
<pre><span class="keyword">val</span> <a name="VALformat_of_string"></a>format_of_string : <code class="type">('a, 'b, 'c, 'd, 'e, 'f) format6 -> ('a, 'b, 'c, 'd, 'e, 'f) format6</code></pre><div class="info">
1016
1022
<code class="code">format_of_string s</code> returns a format string read from the string
1017
1023
    literal <code class="code">s</code>.<br>
1018
1024
</div>
1019
 
<pre><span class="keyword">val</span> <a name="VAL(^^)"></a>(^^) : <code class="type">('a, 'b, 'c, 'd) format4 -><br>       ('d, 'b, 'c, 'e) format4 -> ('a, 'b, 'c, 'e) format4</code></pre><div class="info">
 
1025
<pre><span class="keyword">val</span> <a name="VAL(^^)"></a>(^^) : <code class="type">('a, 'b, 'c, 'd, 'e, 'f) format6 -><br>       ('f, 'b, 'c, 'e, 'g, 'h) format6 -> ('a, 'b, 'c, 'd, 'g, 'h) format6</code></pre><div class="info">
1020
1026
<code class="code">f1 ^^ f2</code> catenates formats <code class="code">f1</code> and <code class="code">f2</code>.  The result is a format
1021
1027
  that accepts arguments from <code class="code">f1</code>, then arguments from <code class="code">f2</code>.<br>
1022
1028
</div>