package batteries
- Overview
- No Docs
You can search for identifiers within the package.
in-package search v0.2.0
Install
Dune Dependency
Authors
Maintainers
Sources
md5=d02c4f044e53edca010de46f9139ce00
sha512=99a5afa3604c4cf0c849c670111d617f7f255acb0da043b73ddffdf0e299948bce52516ee31921f269de6088156c4e0a187e0b931543c6819c6b25966b303281
doc/batteries.unthreaded/BatInt/Safe_int/index.html
Module BatInt.Safe_int
Source
Safe operations on integers.
This module provides operations on the type int
of integers. Values of this type may be either 31 bits on 32-bit processors or 63 bits on 64-bit processors. Operations which overflow raise exception Number.Overflow
.
This module implements Number.Numeric
, Number.Bounded
, Number.Discrete
.
Important note Untested.
An alias for the type of integers.
Integer division. This division rounds the real quotient of its arguments towards zero, as specified for Pervasives.(/)
.
Integer division. This division rounds the real quotient of its arguments towards zero, as specified for Pervasives.(/)
.
Integer remainder. If y
is not zero, the result of Int.rem x y
satisfies the following property: x = Int.add (Int.mul (Int.div x y) y) (Int.rem x y)
.
modulo a b
computes the remainder of the integer division of a
by b
. This is defined only if b <> 0
.
The result of modulo a b
is a number m
between 0
and abs ( b - 1 )
if a >= 0
or between ~- ( abs ( b - 1 ) )
if a < 0
and such that a * k + (abs b) = m
, for some k
.
Comparison: a <> b
is true if and only if a
and b
have different values.
Comparison: a > b
is true if and only if a
is strictly greater than b
.
Comparison: a < b
is true if and only if a
is strictly smaller than b
.
Comparison: a >= b
is true if and only if a
is greater or equal to b
.
Convert the given floating-point number to integer, discarding the fractional part (truncate towards 0). The result of the conversion is undefined if, after truncation, the number is outside the range [Int.min_int
, Int.max_int
].
Convert the given string to an integer The string is read in decimal (by default) or in hexadecimal, octal or binary if the string begins with 0x
, 0o
or 0b
respectively.
Return the string representation of its argument, in signed decimal.