mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2025-12-06 11:15:31 -05:00
2 lines
No EOL
28 KiB
HTML
2 lines
No EOL
28 KiB
HTML
<!DOCTYPE html>
|
||
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>CCInt64 (containers.CCInt64)</title><link rel="stylesheet" href="../../odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc %%VERSION%%"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div class="content"><header><nav><a href="../index.html">Up</a> – <a href="../index.html">containers</a> » CCInt64</nav><h1>Module <code>CCInt64</code></h1><h2 id="int64"><a href="#int64" class="anchor"></a>Int64</h2><p>Helpers for 64-bit integers</p><dl><dt>since</dt><dd>0.13</dd></dl><nav class="toc"><ul><li><a href="#conversion">Conversion</a></li></ul></nav></header><div><div class="spec include"><div class="doc"><details open="open"><summary><span class="def"><code><span class="keyword">include</span> <span class="keyword">module</span> <span class="keyword">type</span> <span class="keyword">of</span> <span class="keyword">sig</span> ... <span class="keyword">end</span></code></span></summary><dl><dt class="spec value" id="val-zero"><a href="#val-zero" class="anchor"></a><code><span class="keyword">val</span> zero : int64</code></dt><dt class="spec value" id="val-one"><a href="#val-one" class="anchor"></a><code><span class="keyword">val</span> one : int64</code></dt><dt class="spec value" id="val-minus_one"><a href="#val-minus_one" class="anchor"></a><code><span class="keyword">val</span> minus_one : int64</code></dt></dl><dl><dt class="spec external" id="val-neg"><a href="#val-neg" class="anchor"></a><code><span class="keyword">val</span> neg : int64 <span>-></span> int64</code></dt><dt class="spec external" id="val-add"><a href="#val-add" class="anchor"></a><code><span class="keyword">val</span> add : int64 <span>-></span> int64 <span>-></span> int64</code></dt><dt class="spec external" id="val-sub"><a href="#val-sub" class="anchor"></a><code><span class="keyword">val</span> sub : int64 <span>-></span> int64 <span>-></span> int64</code></dt><dt class="spec external" id="val-mul"><a href="#val-mul" class="anchor"></a><code><span class="keyword">val</span> mul : int64 <span>-></span> int64 <span>-></span> int64</code></dt><dt class="spec external" id="val-div"><a href="#val-div" class="anchor"></a><code><span class="keyword">val</span> div : int64 <span>-></span> int64 <span>-></span> int64</code></dt><dt class="spec external" id="val-rem"><a href="#val-rem" class="anchor"></a><code><span class="keyword">val</span> rem : int64 <span>-></span> int64 <span>-></span> int64</code></dt></dl><dl><dt class="spec value" id="val-succ"><a href="#val-succ" class="anchor"></a><code><span class="keyword">val</span> succ : int64 <span>-></span> int64</code></dt><dt class="spec value" id="val-pred"><a href="#val-pred" class="anchor"></a><code><span class="keyword">val</span> pred : int64 <span>-></span> int64</code></dt><dt class="spec value" id="val-abs"><a href="#val-abs" class="anchor"></a><code><span class="keyword">val</span> abs : int64 <span>-></span> int64</code></dt><dt class="spec value" id="val-max_int"><a href="#val-max_int" class="anchor"></a><code><span class="keyword">val</span> max_int : int64</code></dt><dt class="spec value" id="val-min_int"><a href="#val-min_int" class="anchor"></a><code><span class="keyword">val</span> min_int : int64</code></dt></dl><dl><dt class="spec external" id="val-logand"><a href="#val-logand" class="anchor"></a><code><span class="keyword">val</span> logand : int64 <span>-></span> int64 <span>-></span> int64</code></dt><dt class="spec external" id="val-logor"><a href="#val-logor" class="anchor"></a><code><span class="keyword">val</span> logor : int64 <span>-></span> int64 <span>-></span> int64</code></dt><dt class="spec external" id="val-logxor"><a href="#val-logxor" class="anchor"></a><code><span class="keyword">val</span> logxor : int64 <span>-></span> int64 <span>-></span> int64</code></dt></dl><dl><dt class="spec value" id="val-lognot"><a href="#val-lognot" class="anchor"></a><code><span class="keyword">val</span> lognot : int64 <span>-></span> int64</code></dt></dl><dl><dt class="spec external" id="val-shift_left"><a href="#val-shift_left" class="anchor"></a><code><span class="keyword">val</span> shift_left : int64 <span>-></span> int <span>-></span> int64</code></dt><dt class="spec external" id="val-shift_right"><a href="#val-shift_right" class="anchor"></a><code><span class="keyword">val</span> shift_right : int64 <span>-></span> int <span>-></span> int64</code></dt><dt class="spec external" id="val-shift_right_logical"><a href="#val-shift_right_logical" class="anchor"></a><code><span class="keyword">val</span> shift_right_logical : int64 <span>-></span> int <span>-></span> int64</code></dt><dt class="spec external" id="val-of_int"><a href="#val-of_int" class="anchor"></a><code><span class="keyword">val</span> of_int : int <span>-></span> int64</code></dt><dt class="spec external" id="val-to_int"><a href="#val-to_int" class="anchor"></a><code><span class="keyword">val</span> to_int : int64 <span>-></span> int</code></dt><dt class="spec external" id="val-of_float"><a href="#val-of_float" class="anchor"></a><code><span class="keyword">val</span> of_float : float <span>-></span> int64</code></dt><dt class="spec external" id="val-to_float"><a href="#val-to_float" class="anchor"></a><code><span class="keyword">val</span> to_float : int64 <span>-></span> float</code></dt><dt class="spec external" id="val-of_int32"><a href="#val-of_int32" class="anchor"></a><code><span class="keyword">val</span> of_int32 : int32 <span>-></span> int64</code></dt><dt class="spec external" id="val-to_int32"><a href="#val-to_int32" class="anchor"></a><code><span class="keyword">val</span> to_int32 : int64 <span>-></span> int32</code></dt><dt class="spec external" id="val-of_nativeint"><a href="#val-of_nativeint" class="anchor"></a><code><span class="keyword">val</span> of_nativeint : nativeint <span>-></span> int64</code></dt><dt class="spec external" id="val-to_nativeint"><a href="#val-to_nativeint" class="anchor"></a><code><span class="keyword">val</span> to_nativeint : int64 <span>-></span> nativeint</code></dt><dt class="spec external" id="val-of_string"><a href="#val-of_string" class="anchor"></a><code><span class="keyword">val</span> of_string : string <span>-></span> int64</code></dt></dl><dl><dt class="spec value" id="val-of_string_opt"><a href="#val-of_string_opt" class="anchor"></a><code><span class="keyword">val</span> of_string_opt : string <span>-></span> <span>int64 option</span></code></dt><dt class="spec value" id="val-to_string"><a href="#val-to_string" class="anchor"></a><code><span class="keyword">val</span> to_string : int64 <span>-></span> string</code></dt></dl><dl><dt class="spec external" id="val-bits_of_float"><a href="#val-bits_of_float" class="anchor"></a><code><span class="keyword">val</span> bits_of_float : float <span>-></span> int64</code></dt><dt class="spec external" id="val-float_of_bits"><a href="#val-float_of_bits" class="anchor"></a><code><span class="keyword">val</span> float_of_bits : int64 <span>-></span> float</code></dt></dl><dl><dt class="spec type" id="type-t"><a href="#type-t" class="anchor"></a><code><span class="keyword">type</span> t</code><code> = int64</code></dt></dl><dl><dt class="spec value" id="val-compare"><a href="#val-compare" class="anchor"></a><code><span class="keyword">val</span> compare : <a href="index.html#type-t">t</a> <span>-></span> <a href="index.html#type-t">t</a> <span>-></span> int</code></dt><dt class="spec value" id="val-equal"><a href="#val-equal" class="anchor"></a><code><span class="keyword">val</span> equal : <a href="index.html#type-t">t</a> <span>-></span> <a href="index.html#type-t">t</a> <span>-></span> bool</code></dt></dl><dl><dt class="spec external" id="val-format"><a href="#val-format" class="anchor"></a><code><span class="keyword">val</span> format : string <span>-></span> int64 <span>-></span> string</code></dt></dl></details></div></div></div><dl><dt class="spec value" id="val-(+)"><a href="#val-(+)" class="anchor"></a><code><span class="keyword">val</span> (+) : <a href="index.html#type-t">t</a> <span>-></span> <a href="index.html#type-t">t</a> <span>-></span> <a href="index.html#type-t">t</a></code></dt><dd><p>Addition.</p></dd></dl><dl><dt class="spec value" id="val-(-)"><a href="#val-(-)" class="anchor"></a><code><span class="keyword">val</span> (-) : <a href="index.html#type-t">t</a> <span>-></span> <a href="index.html#type-t">t</a> <span>-></span> <a href="index.html#type-t">t</a></code></dt><dd><p>Subtraction.</p></dd></dl><dl><dt class="spec value" id="val-(~-)"><a href="#val-(~-)" class="anchor"></a><code><span class="keyword">val</span> (~-) : <a href="index.html#type-t">t</a> <span>-></span> <a href="index.html#type-t">t</a></code></dt><dd><p>Unary negation.</p></dd></dl><dl><dt class="spec value" id="val-(*)"><a href="#val-(*)" class="anchor"></a><code><span class="keyword">val</span> (*) : <a href="index.html#type-t">t</a> <span>-></span> <a href="index.html#type-t">t</a> <span>-></span> <a href="index.html#type-t">t</a></code></dt><dd><p>Multiplication.</p></dd></dl><dl><dt class="spec value" id="val-(/)"><a href="#val-(/)" class="anchor"></a><code><span class="keyword">val</span> (/) : <a href="index.html#type-t">t</a> <span>-></span> <a href="index.html#type-t">t</a> <span>-></span> <a href="index.html#type-t">t</a></code></dt><dd><p>Integer division. Raise <code>Division_by_zero</code> if the second argument is zero. This division rounds the real quotient of its arguments towards zero, as specified for <span class="xref-unresolved" title="unresolved reference to "Pervasives.(/)""><code>Pervasives</code>.(/)</span>.</p></dd></dl><dl><dt class="spec value" id="val-(mod)"><a href="#val-(mod)" class="anchor"></a><code><span class="keyword">val</span> (mod) : <a href="index.html#type-t">t</a> <span>-></span> <a href="index.html#type-t">t</a> <span>-></span> <a href="index.html#type-t">t</a></code></dt><dd><p>Integer remainder. If <code>y = 0</code>, <code>x mod y</code> raises <code>Division_by_zero</code>.</p></dd></dl><dl><dt class="spec value" id="val-abs"><a href="#val-abs" class="anchor"></a><code><span class="keyword">val</span> abs : <a href="index.html#type-t">t</a> <span>-></span> <a href="index.html#type-t">t</a></code></dt><dd><p>Return the absolute value of its argument.</p></dd></dl><dl><dt class="spec value" id="val-max_int"><a href="#val-max_int" class="anchor"></a><code><span class="keyword">val</span> max_int : <a href="index.html#type-t">t</a></code></dt><dd><p>The greatest representable 64-bit integer, 2<sup>63</sup> - 1 = <code>9_223_372_036_854_775_807</code>.</p></dd></dl><dl><dt class="spec value" id="val-min_int"><a href="#val-min_int" class="anchor"></a><code><span class="keyword">val</span> min_int : <a href="index.html#type-t">t</a></code></dt><dd><p>The smallest representable 64-bit integer, -2<sup>63</sup> = <code>-9_223_372_036_854_775_808</code>.</p></dd></dl><dl><dt class="spec value" id="val-(land)"><a href="#val-(land)" class="anchor"></a><code><span class="keyword">val</span> (land) : <a href="index.html#type-t">t</a> <span>-></span> <a href="index.html#type-t">t</a> <span>-></span> <a href="index.html#type-t">t</a></code></dt><dd><p>Bitwise logical and.</p></dd></dl><dl><dt class="spec value" id="val-(lor)"><a href="#val-(lor)" class="anchor"></a><code><span class="keyword">val</span> (lor) : <a href="index.html#type-t">t</a> <span>-></span> <a href="index.html#type-t">t</a> <span>-></span> <a href="index.html#type-t">t</a></code></dt><dd><p>Bitwise logical or.</p></dd></dl><dl><dt class="spec value" id="val-(lxor)"><a href="#val-(lxor)" class="anchor"></a><code><span class="keyword">val</span> (lxor) : <a href="index.html#type-t">t</a> <span>-></span> <a href="index.html#type-t">t</a> <span>-></span> <a href="index.html#type-t">t</a></code></dt><dd><p>Bitwise logical exclusive or.</p></dd></dl><dl><dt class="spec value" id="val-(lnot)"><a href="#val-(lnot)" class="anchor"></a><code><span class="keyword">val</span> (lnot) : <a href="index.html#type-t">t</a> <span>-></span> <a href="index.html#type-t">t</a></code></dt><dd><p>Bitwise logical negation.</p></dd></dl><dl><dt class="spec value" id="val-(lsl)"><a href="#val-(lsl)" class="anchor"></a><code><span class="keyword">val</span> (lsl) : <a href="index.html#type-t">t</a> <span>-></span> int <span>-></span> <a href="index.html#type-t">t</a></code></dt><dd><p><code> x lsl y</code> shifts <code>x</code> to the left by <code>y</code> bits, filling in with zeroes. The result is unspecified if <code>y < 0</code> or <code>y >= 64</code>.</p></dd></dl><dl><dt class="spec value" id="val-(lsr)"><a href="#val-(lsr)" class="anchor"></a><code><span class="keyword">val</span> (lsr) : <a href="index.html#type-t">t</a> <span>-></span> int <span>-></span> <a href="index.html#type-t">t</a></code></dt><dd><p><code>x lsr y</code> shifts <code>x</code> to the right by <code>y</code> bits. This is a logical shift: zeroes are inserted in the vacated bits regardless of the sign of <code>x</code>. The result is unspecified if <code>y < 0</code> or <code>y >= 64</code>.</p></dd></dl><dl><dt class="spec value" id="val-(asr)"><a href="#val-(asr)" class="anchor"></a><code><span class="keyword">val</span> (asr) : <a href="index.html#type-t">t</a> <span>-></span> int <span>-></span> <a href="index.html#type-t">t</a></code></dt><dd><p><code>x asr y</code> shifts <code>x</code> to the right by <code>y</code> bits. This is an arithmetic shift: the sign bit of <code>x</code> is replicated and inserted in the vacated bits. The result is unspecified if <code>y < 0</code> or <code>y >= 64</code>.</p></dd></dl><dl><dt class="spec module" id="module-Infix"><a href="#module-Infix" class="anchor"></a><code><span class="keyword">module</span> <a href="Infix/index.html">Infix</a> : <span class="keyword">sig</span> ... <span class="keyword">end</span></code></dt><dd><p>Infix operators</p></dd></dl><div><div class="spec include"><div class="doc"><details open="open"><summary><span class="def"><code><span class="keyword">include</span> <span class="keyword">module</span> <span class="keyword">type</span> <span class="keyword">of</span> <a href="index.html#module-Infix">Infix</a></code></span></summary><dl><dt class="spec value" id="val-(+)"><a href="#val-(+)" class="anchor"></a><code><span class="keyword">val</span> (+) : <a href="index.html#type-t">t</a> <span>-></span> <a href="index.html#type-t">t</a> <span>-></span> <a href="index.html#type-t">t</a></code></dt><dt class="spec value" id="val-(-)"><a href="#val-(-)" class="anchor"></a><code><span class="keyword">val</span> (-) : <a href="index.html#type-t">t</a> <span>-></span> <a href="index.html#type-t">t</a> <span>-></span> <a href="index.html#type-t">t</a></code></dt><dt class="spec value" id="val-(~-)"><a href="#val-(~-)" class="anchor"></a><code><span class="keyword">val</span> (~-) : <a href="index.html#type-t">t</a> <span>-></span> <a href="index.html#type-t">t</a></code></dt><dt class="spec value" id="val-(*)"><a href="#val-(*)" class="anchor"></a><code><span class="keyword">val</span> (*) : <a href="index.html#type-t">t</a> <span>-></span> <a href="index.html#type-t">t</a> <span>-></span> <a href="index.html#type-t">t</a></code></dt><dt class="spec value" id="val-(/)"><a href="#val-(/)" class="anchor"></a><code><span class="keyword">val</span> (/) : <a href="index.html#type-t">t</a> <span>-></span> <a href="index.html#type-t">t</a> <span>-></span> <a href="index.html#type-t">t</a></code></dt><dt class="spec value" id="val-(mod)"><a href="#val-(mod)" class="anchor"></a><code><span class="keyword">val</span> (mod) : <a href="index.html#type-t">t</a> <span>-></span> <a href="index.html#type-t">t</a> <span>-></span> <a href="index.html#type-t">t</a></code></dt><dt class="spec value" id="val-(land)"><a href="#val-(land)" class="anchor"></a><code><span class="keyword">val</span> (land) : <a href="index.html#type-t">t</a> <span>-></span> <a href="index.html#type-t">t</a> <span>-></span> <a href="index.html#type-t">t</a></code></dt><dt class="spec value" id="val-(lor)"><a href="#val-(lor)" class="anchor"></a><code><span class="keyword">val</span> (lor) : <a href="index.html#type-t">t</a> <span>-></span> <a href="index.html#type-t">t</a> <span>-></span> <a href="index.html#type-t">t</a></code></dt><dt class="spec value" id="val-(lxor)"><a href="#val-(lxor)" class="anchor"></a><code><span class="keyword">val</span> (lxor) : <a href="index.html#type-t">t</a> <span>-></span> <a href="index.html#type-t">t</a> <span>-></span> <a href="index.html#type-t">t</a></code></dt><dt class="spec value" id="val-(lnot)"><a href="#val-(lnot)" class="anchor"></a><code><span class="keyword">val</span> (lnot) : <a href="index.html#type-t">t</a> <span>-></span> <a href="index.html#type-t">t</a></code></dt><dt class="spec value" id="val-(lsl)"><a href="#val-(lsl)" class="anchor"></a><code><span class="keyword">val</span> (lsl) : <a href="index.html#type-t">t</a> <span>-></span> int <span>-></span> <a href="index.html#type-t">t</a></code></dt><dt class="spec value" id="val-(lsr)"><a href="#val-(lsr)" class="anchor"></a><code><span class="keyword">val</span> (lsr) : <a href="index.html#type-t">t</a> <span>-></span> int <span>-></span> <a href="index.html#type-t">t</a></code></dt><dt class="spec value" id="val-(asr)"><a href="#val-(asr)" class="anchor"></a><code><span class="keyword">val</span> (asr) : <a href="index.html#type-t">t</a> <span>-></span> int <span>-></span> <a href="index.html#type-t">t</a></code></dt><dt class="spec value" id="val-(=)"><a href="#val-(=)" class="anchor"></a><code><span class="keyword">val</span> (=) : <a href="index.html#type-t">t</a> <span>-></span> <a href="index.html#type-t">t</a> <span>-></span> bool</code></dt><dt class="spec value" id="val-(<>)"><a href="#val-(<>)" class="anchor"></a><code><span class="keyword">val</span> (<>) : <a href="index.html#type-t">t</a> <span>-></span> <a href="index.html#type-t">t</a> <span>-></span> bool</code></dt><dt class="spec value" id="val-(>)"><a href="#val-(>)" class="anchor"></a><code><span class="keyword">val</span> (>) : <a href="index.html#type-t">t</a> <span>-></span> <a href="index.html#type-t">t</a> <span>-></span> bool</code></dt><dt class="spec value" id="val-(>=)"><a href="#val-(>=)" class="anchor"></a><code><span class="keyword">val</span> (>=) : <a href="index.html#type-t">t</a> <span>-></span> <a href="index.html#type-t">t</a> <span>-></span> bool</code></dt><dt class="spec value" id="val-(<=)"><a href="#val-(<=)" class="anchor"></a><code><span class="keyword">val</span> (<=) : <a href="index.html#type-t">t</a> <span>-></span> <a href="index.html#type-t">t</a> <span>-></span> bool</code></dt><dt class="spec value" id="val-(<)"><a href="#val-(<)" class="anchor"></a><code><span class="keyword">val</span> (<) : <a href="index.html#type-t">t</a> <span>-></span> <a href="index.html#type-t">t</a> <span>-></span> bool</code></dt></dl></details></div></div></div><dl><dt class="spec value" id="val-equal"><a href="#val-equal" class="anchor"></a><code><span class="keyword">val</span> equal : <a href="index.html#type-t">t</a> <span>-></span> <a href="index.html#type-t">t</a> <span>-></span> bool</code></dt><dd><p>The equal function for 64-bit integers. Like <code>Pervasives.(=) x y)</code>.</p></dd></dl><dl><dt class="spec value" id="val-compare"><a href="#val-compare" class="anchor"></a><code><span class="keyword">val</span> compare : <a href="index.html#type-t">t</a> <span>-></span> <a href="index.html#type-t">t</a> <span>-></span> int</code></dt><dd><p>The comparison function for 64-bit integers, with the same specification as <span class="xref-unresolved" title="unresolved reference to "Pervasives.compare""><code>Pervasives</code>.compare</span>. Along with the type <code>t</code>, this function <code>compare</code> allows the module <code>CCInt64</code> to be passed as argument to the functors <span class="xref-unresolved" title="unresolved reference to "Set.Make""><code>Set</code>.Make</span> and <span class="xref-unresolved" title="unresolved reference to "Map.Make""><code>Map</code>.Make</span>.</p></dd></dl><dl><dt class="spec value" id="val-hash"><a href="#val-hash" class="anchor"></a><code><span class="keyword">val</span> hash : <a href="index.html#type-t">t</a> <span>-></span> int</code></dt><dd><p>Like <span class="xref-unresolved" title="unresolved reference to "Pervasives.abs (to_int x)""><code>Pervasives</code>.abs (to_int x)</span>.</p></dd></dl><section><header><h3 id="conversion"><a href="#conversion" class="anchor"></a>Conversion</h3></header><dl><dt class="spec value" id="val-to_int"><a href="#val-to_int" class="anchor"></a><code><span class="keyword">val</span> to_int : <a href="index.html#type-t">t</a> <span>-></span> int</code></dt><dd><p>Convert the given 64-bit integer (type <code>int64</code>) to an integer (type <code>int</code>). On 64-bit platforms, the 64-bit integer is taken modulo 2<sup>63</sup>, i.e. the high-order bit is lost during the conversion. On 32-bit platforms, the 64-bit integer is taken modulo 2<sup>31</sup>, i.e. the top 33 bits are lost during the conversion.</p></dd></dl><dl><dt class="spec value" id="val-of_int"><a href="#val-of_int" class="anchor"></a><code><span class="keyword">val</span> of_int : int <span>-></span> <a href="index.html#type-t">t</a></code></dt><dd><p>Alias to <span class="xref-unresolved" title="unresolved reference to "Int64.of_int""><code>Int64</code>.of_int</span>. NOTE: used to return an option, but the function actually never fails.</p></dd></dl><dl><dt class="spec value" id="val-of_int_exn"><a href="#val-of_int_exn" class="anchor"></a><code><span class="keyword">val</span> of_int_exn : int <span>-></span> <a href="index.html#type-t">t</a></code></dt><dt class="spec value" id="val-to_int32"><a href="#val-to_int32" class="anchor"></a><code><span class="keyword">val</span> to_int32 : <a href="index.html#type-t">t</a> <span>-></span> int32</code></dt><dd><p>Convert the given 64-bit integer (type <code>int64</code>) to a 32-bit integer (type <code>int32</code>). The 64-bit integer is taken modulo 2<sup>32</sup>, i.e. the top 32 bits are lost during the conversion.</p></dd></dl><dl><dt class="spec value" id="val-of_int32"><a href="#val-of_int32" class="anchor"></a><code><span class="keyword">val</span> of_int32 : int32 <span>-></span> <a href="index.html#type-t">t</a></code></dt><dd><p>Alias to <span class="xref-unresolved" title="unresolved reference to "Int64.of_int32""><code>Int64</code>.of_int32</span>. NOTE: use to return an option, but the function actually never fails.</p></dd></dl><dl><dt class="spec value" id="val-of_int32_exn"><a href="#val-of_int32_exn" class="anchor"></a><code><span class="keyword">val</span> of_int32_exn : int32 <span>-></span> <a href="index.html#type-t">t</a></code></dt><dt class="spec value" id="val-to_nativeint"><a href="#val-to_nativeint" class="anchor"></a><code><span class="keyword">val</span> to_nativeint : <a href="index.html#type-t">t</a> <span>-></span> nativeint</code></dt><dd><p>Convert the given 64-bit integer (type <code>int64</code>) to a native integer. On 32-bit platforms, the 64-bit integer is taken modulo 2<sup>32</sup>. On 64-bit platforms, the conversion is exact.</p></dd></dl><dl><dt class="spec value" id="val-of_nativeint"><a href="#val-of_nativeint" class="anchor"></a><code><span class="keyword">val</span> of_nativeint : nativeint <span>-></span> <a href="index.html#type-t">t</a></code></dt><dd><p>Alias to <span class="xref-unresolved" title="unresolved reference to "Int64.of_nativeint""><code>Int64</code>.of_nativeint</span>. NOTE: use to return an option, but the function actually never fails.</p></dd></dl><dl><dt class="spec value" id="val-of_nativeint_exn"><a href="#val-of_nativeint_exn" class="anchor"></a><code><span class="keyword">val</span> of_nativeint_exn : nativeint <span>-></span> <a href="index.html#type-t">t</a></code></dt><dt class="spec value" id="val-to_float"><a href="#val-to_float" class="anchor"></a><code><span class="keyword">val</span> to_float : <a href="index.html#type-t">t</a> <span>-></span> float</code></dt><dd><p>Convert the given 64-bit integer to a floating-point number.</p></dd></dl><dl><dt class="spec value" id="val-of_float"><a href="#val-of_float" class="anchor"></a><code><span class="keyword">val</span> of_float : float <span>-></span> <a href="index.html#type-t">t</a></code></dt><dd><p>Alias to <span class="xref-unresolved" title="unresolved reference to "Int64.of_float""><code>Int64</code>.of_float</span>. Convert the given floating-point number to a 64-bit integer, discarding the fractional part (truncate towards 0). The result of the conversion is undefined if, after truncation, the number is outside the range [<a href="index.html#val-min_int"><code>CCInt64.min_int</code></a>, <a href="index.html#val-max_int"><code>CCInt64.max_int</code></a>]. NOTE: used to return an option, but the function never fails.</p></dd></dl><dl><dt class="spec value" id="val-of_float_exn"><a href="#val-of_float_exn" class="anchor"></a><code><span class="keyword">val</span> of_float_exn : float <span>-></span> <a href="index.html#type-t">t</a></code></dt><dt class="spec value" id="val-to_string"><a href="#val-to_string" class="anchor"></a><code><span class="keyword">val</span> to_string : <a href="index.html#type-t">t</a> <span>-></span> string</code></dt><dd><p>Return the string representation of its argument, in decimal.</p></dd></dl><dl><dt class="spec value" id="val-of_string"><a href="#val-of_string" class="anchor"></a><code><span class="keyword">val</span> of_string : string <span>-></span> <span><a href="index.html#type-t">t</a> option</span></code></dt><dd><p>Safe version of <a href="index.html#val-of_string_exn"><code>of_string_exn</code></a>.</p></dd></dl><dl><dt class="spec value" id="val-of_string_opt"><a href="#val-of_string_opt" class="anchor"></a><code><span class="keyword">val</span> of_string_opt : string <span>-></span> <span><a href="index.html#type-t">t</a> option</span></code></dt><dd><p>Alias to <a href="index.html#val-of_string"><code>of_string</code></a>.</p><dl><dt>since</dt><dd>2.1</dd></dl></dd></dl><dl><dt class="spec value" id="val-of_string_exn"><a href="#val-of_string_exn" class="anchor"></a><code><span class="keyword">val</span> of_string_exn : string <span>-></span> <a href="index.html#type-t">t</a></code></dt><dd><p>Alias to <span class="xref-unresolved" title="unresolved reference to "Int64.of_string""><code>Int64</code>.of_string</span>. Convert the given string to a 64-bit integer. The string is read in decimal (by default, or if the string begins with <code>0u</code>) or in hexadecimal, octal or binary if the string begins with <code>0x</code>, <code>0o</code> or <code>0b</code> respectively.</p><p>The <code>0u</code> prefix reads the input as an unsigned integer in the range <code>[0, 2*CCInt64.max_int+1]</code>. If the input exceeds <a href="index.html#val-max_int"><code>CCInt64.max_int</code></a> it is converted to the signed integer <code>CCInt64.min_int + input - CCInt64.max_int - 1</code>.</p><p>The <code>_</code> (underscore) character can appear anywhere in the string and is ignored. Raise <code>Failure "Int64.of_string"</code> if the given string is not a valid representation of an integer, or if the integer represented exceeds the range of integers representable in type <code>int64</code>.</p></dd></dl></section></div></body></html> |