1Stdlib.Int64(3)                  OCaml library                 Stdlib.Int64(3)
2
3
4

NAME

6       Stdlib.Int64 - no description
7

Module

9       Module   Stdlib.Int64
10

Documentation

12       Module Int64
13        : (module Stdlib__Int64)
14
15
16
17
18
19
20
21
22       val zero : int64
23
24       The 64-bit integer 0.
25
26
27
28       val one : int64
29
30       The 64-bit integer 1.
31
32
33
34       val minus_one : int64
35
36       The 64-bit integer -1.
37
38
39
40       val neg : int64 -> int64
41
42       Unary negation.
43
44
45
46       val add : int64 -> int64 -> int64
47
48       Addition.
49
50
51
52       val sub : int64 -> int64 -> int64
53
54       Subtraction.
55
56
57
58       val mul : int64 -> int64 -> int64
59
60       Multiplication.
61
62
63
64       val div : int64 -> int64 -> int64
65
66       Integer division.
67
68
69       Raises  Division_by_zero if the second argument is zero.  This division
70       rounds the real quotient of its arguments towards  zero,  as  specified
71       for (/) .
72
73
74
75       val unsigned_div : int64 -> int64 -> int64
76
77       Same as Int64.div , except that arguments and result are interpreted as
78       unsigned 64-bit integers.
79
80
81       Since 4.08.0
82
83
84
85       val rem : int64 -> int64 -> int64
86
87       Integer remainder.  If y is not zero, the result of Int64.rem x y  sat‐
88       isfies the following property: x = Int64.add (Int64.mul (Int64.div x y)
89       y) (Int64.rem x y) .  If y = 0 , Int64.rem x y raises  Division_by_zero
90       .
91
92
93
94       val unsigned_rem : int64 -> int64 -> int64
95
96       Same as Int64.rem , except that arguments and result are interpreted as
97       unsigned 64-bit integers.
98
99
100       Since 4.08.0
101
102
103
104       val succ : int64 -> int64
105
106       Successor.  Int64.succ x is Int64.add x Int64.one .
107
108
109
110       val pred : int64 -> int64
111
112       Predecessor.  Int64.pred x is Int64.sub x Int64.one .
113
114
115
116       val abs : int64 -> int64
117
118       Return the absolute value of its argument.
119
120
121
122       val max_int : int64
123
124       The greatest representable 64-bit integer, 2^63 - 1.
125
126
127
128       val min_int : int64
129
130       The smallest representable 64-bit integer, -2^63.
131
132
133
134       val logand : int64 -> int64 -> int64
135
136       Bitwise logical and.
137
138
139
140       val logor : int64 -> int64 -> int64
141
142       Bitwise logical or.
143
144
145
146       val logxor : int64 -> int64 -> int64
147
148       Bitwise logical exclusive or.
149
150
151
152       val lognot : int64 -> int64
153
154       Bitwise logical negation.
155
156
157
158       val shift_left : int64 -> int -> int64
159
160
161       Int64.shift_left x y shifts x to the left by y bits.  The result is un‐
162       specified if y < 0 or y >= 64 .
163
164
165
166       val shift_right : int64 -> int -> int64
167
168
169       Int64.shift_right  x  y  shifts  x  to the right by y bits.  This is an
170       arithmetic shift: the sign bit of x is replicated and inserted  in  the
171       vacated bits.  The result is unspecified if y < 0 or y >= 64 .
172
173
174
175       val shift_right_logical : int64 -> int -> int64
176
177
178       Int64.shift_right_logical x y shifts x to the right by y bits.  This is
179       a logical shift: zeroes are inserted in the vacated bits regardless  of
180       the sign of x .  The result is unspecified if y < 0 or y >= 64 .
181
182
183
184       val of_int : int -> int64
185
186       Convert  the  given integer (type int ) to a 64-bit integer (type int64
187       ).
188
189
190
191       val to_int : int64 -> int
192
193       Convert the given 64-bit integer (type int64 ) to an integer (type  int
194       ).   On 64-bit platforms, the 64-bit integer is taken modulo 2^63, i.e.
195       the high-order bit is lost during the conversion.  On 32-bit platforms,
196       the  64-bit integer is taken modulo 2^31, i.e. the top 33 bits are lost
197       during the conversion.
198
199
200
201       val unsigned_to_int : int64 -> int option
202
203       Same as Int64.to_int , but interprets the argument as an unsigned inte‐
204       ger.   Returns  None  if  the unsigned value of the argument cannot fit
205       into an int .
206
207
208       Since 4.08.0
209
210
211
212       val of_float : float -> int64
213
214       Convert the given floating-point number to a 64-bit integer, discarding
215       the  fractional  part  (truncate  towards  0).  If the truncated float‐
216       ing-point number is outside the range [ Int64.min_int  ,  Int64.max_int
217       ], no exception is raised, and an unspecified, platform-dependent inte‐
218       ger is returned.
219
220
221
222       val to_float : int64 -> float
223
224       Convert the given 64-bit integer to a floating-point number.
225
226
227
228       val of_int32 : int32 -> int64
229
230       Convert the given 32-bit integer (type int32  )  to  a  64-bit  integer
231       (type int64 ).
232
233
234
235       val to_int32 : int64 -> int32
236
237       Convert  the  given  64-bit  integer  (type int64 ) to a 32-bit integer
238       (type int32 ). The 64-bit integer is taken modulo 2^32, i.e. the top 32
239       bits are lost during the conversion.
240
241
242
243       val of_nativeint : nativeint -> int64
244
245       Convert  the given native integer (type nativeint ) to a 64-bit integer
246       (type int64 ).
247
248
249
250       val to_nativeint : int64 -> nativeint
251
252       Convert the given 64-bit integer (type int64 ) to a native integer.  On
253       32-bit  platforms,  the 64-bit integer is taken modulo 2^32.  On 64-bit
254       platforms, the conversion is exact.
255
256
257
258       val of_string : string -> int64
259
260       Convert the given string to a 64-bit integer.  The string  is  read  in
261       decimal  (by default, or if the string begins with 0u ) or in hexadeci‐
262       mal, octal or binary if the string begins with 0x , 0o  or  0b  respec‐
263       tively.
264
265       The  0u  prefix reads the input as an unsigned integer in the range [0,
266       2*Int64.max_int+1] .  If the input exceeds  Int64.max_int  it  is  con‐
267       verted  to the signed integer Int64.min_int + input - Int64.max_int - 1
268       .
269
270       The _ (underscore) character can appear anywhere in the string  and  is
271       ignored.
272
273
274       Raises  Failure if the given string is not a valid representation of an
275       integer, or if the integer represented exceeds the  range  of  integers
276       representable in type int64 .
277
278
279
280       val of_string_opt : string -> int64 option
281
282       Same as of_string , but return None instead of raising.
283
284
285       Since 4.05
286
287
288
289       val to_string : int64 -> string
290
291       Return the string representation of its argument, in decimal.
292
293
294
295       val bits_of_float : float -> int64
296
297       Return  the internal representation of the given float according to the
298       IEEE 754 floating-point 'double format' bit layout.  Bit 63 of the  re‐
299       sult represents the sign of the float; bits 62 to 52 represent the (bi‐
300       ased) exponent; bits 51 to 0 represent the mantissa.
301
302
303
304       val float_of_bits : int64 -> float
305
306       Return the floating-point number whose internal representation, accord‐
307       ing  to  the IEEE 754 floating-point 'double format' bit layout, is the
308       given int64 .
309
310
311       type t = int64
312
313
314       An alias for the type of 64-bit integers.
315
316
317
318       val compare : t -> t -> int
319
320       The comparison function for 64-bit integers, with the  same  specifica‐
321       tion as compare .  Along with the type t , this function compare allows
322       the module Int64 to be passed as argument to the functors Set.Make  and
323       Map.Make .
324
325
326
327       val unsigned_compare : t -> t -> int
328
329       Same  as  Int64.compare  , except that arguments are interpreted as un‐
330       signed 64-bit integers.
331
332
333       Since 4.08.0
334
335
336
337       val equal : t -> t -> bool
338
339       The equal function for int64s.
340
341
342       Since 4.03.0
343
344
345
346       val min : t -> t -> t
347
348       Return the smaller of the two arguments.
349
350
351       Since 4.13.0
352
353
354
355       val max : t -> t -> t
356
357       Return the greater of the two arguments.
358
359
360       Since 4.13.0
361
362
363
364
365
366OCamldoc                          2022-07-22                   Stdlib.Int64(3)
Impressum