# 32-bit signed integers.

Using 32-bit signed two's complement representation with wrapping on overflow, e.g. `max-int32std/num/int32/max-int32: int32 + 1.int32 == min-int32std/num/int32/min-int32: int32`.

Euclidean-0 modulus. See `(/):(x : int32std/core/types/int32: V, y : int32std/core/types/int32: V) -> int32std/core/types/int32: V` division for more information.

Multiply two 32-bit integers.

Euclidean-0 division. Euclidean division is defined as: For any `D` and `d` where `d!=0` , we have:

1. `D == d*(D/d) + (D%d)`
2. `D%d` is always positive where `0 <= D%d < abs(d)`

Moreover, Euclidean-0 is a total function, for the case where `d==0` we have that `D%0 == D` and `D/0 == 0` . So property (1) still holds, but not property (2). Useful laws that hold for Euclidean-0 division:

• `D/(-d) == -(D/d)`
• `D%(-d) == D%d`
• `D/(2^n) == sarstd/num/int32/sar: (i : int32, shift : int) -> int32(D,n)` (with `0 <= n <= 31`)
• `D%(2n) == D & ((2n) - 1)` (with `0 <= n <= 31`)

Note that an interesting edge case is `min-int32std/num/int32/min-int32: int32 / -1` which equals `min-int32std/num/int32/min-int32: int32` since in modulo 32-bit arithmetic `min-int32std/num/int32/min-int32: int32 == -1 * min-int32std/num/int32/min-int32: int32 == -1 * (min-int32std/num/int32/min-int32: int32 / -1) + (min-int32std/num/int32/min-int32: int32 % -1)` satisfying property (1). Of course `(min-int32std/num/int32/min-int32: int32 + 1) / -1` is again positive (namely `max-int32std/num/int32/max-int32: int32`).

See also Division and modulus for computer scientists, Daan Leijen, 2001 pdf .

Take the bitwise xor of two `int32std/core/types/int32: V`s.

Negate an 32-bit integer.

Return the absolute value of an integer. Raises an exception if the `int32std/core/types/int32: V` is `min-int32std/num/int32/min-int32: int32` (since the negation of `min-int32std/num/int32/min-int32: int32` equals itself and is still negative).

Return the absolute value of an integer. Returns 0 if the `int32std/core/types/int32: V` is `min-int32std/num/int32/min-int32: int32` (since the negation of `min-int32std/num/int32/min-int32: int32` equals itself and is still negative).

Take the bitwise and of two `int32std/core/types/int32: V`s.

The number of bits in an `int32std/core/types/int32: V` (always 32).

Convert an `int32std/core/types/int32: V` to a boolean.

Truncated division (as in C). See also `(/):(x : int32std/core/types/int32: V, y : int32std/core/types/int32: V) -> int32std/core/types/int32: V`.

Truncated modulus (as in C). See also `(%):(x : int32std/core/types/int32: V, y : int32std/core/types/int32: V) -> int32std/core/types/int32: V`.

Decrement a 32-bit integer.

Convert an 32-bit integer to a float64.

fun fold-int32( start : int32std/core/types/int32: V, end : int32std/core/types/int32: V, init : a, f : (int32std/core/types/int32: V, a) -> e a ) : e a

Increment a 32-bit integer.

Convert a boolean to an `int32std/core/types/int32: V`.

Returns `true` if the integer `i` is an even number.

Returns `true` if the integer `i` is an odd number.

Return the maximum of two integers.

The maximal integer value before overflow happens.

Return the minimum of two integers.

The minimal integer value before underflow happens.

Negate a 32-bit integer.

Bitwise not of an `int32std/core/types/int32: V`, i.e. flips all bits.

Take the bitwise or of two `int32std/core/types/int32: V`s.

Bitwise rotate an `int32std/core/types/int32: V` `n % 32` bits to the left.

Bitwise rotate an `int32std/core/types/int32: V` `n % 32` bits to the right.

Arithmetic shift an `int32std/core/types/int32: V` to the right by `n % 32` bits. Shifts in the sign bit from the left.

Shift an `int32std/core/types/int32: V` `i` to the left by `n & 31` bits.

Convert an `int32std/core/types/int32: V` to a string.

fun show-hex( i : int32std/core/types/int32: V, width : ?intstd/core/types/int: V, use-capitals : ?boolstd/core/types/bool: V, pre : ?stringstd/core/types/string: V ) : stringstd/core/types/string: V

Show an `int32std/core/types/int32: V` in hexadecimal notation The `width` parameter specifies how wide the hex value is where `'0'` is used to align.
The `use-capitals` parameter (= `Truestd/core/types/True: bool`) determines if captical letters should be used to display the hexadecimal digits.
The `pre` (=`"0x"`) is an optional prefix for the number (goes between the sign and the number).

fun show-hex32( i : int32std/core/types/int32: V, width : ?intstd/core/types/int: V, use-capitals : ?boolstd/core/types/bool: V, pre : ?stringstd/core/types/string: V ) : stringstd/core/types/string: V

Show an `int32std/core/types/int32: V` in hexadecimal notation interpreted as an unsigned 32-bit value. The `width` parameter specifies how wide the hex value is where `'0'` is used to align.
The `use-capitals` parameter (= `Truestd/core/types/True: bool`) determines if captical letters should be used to display the hexadecimal digits.
The `pre` (=`"0x"`) is an optional prefix for the number.

Logical shift an `int32std/core/types/int32: V` to the right by `n % 32` bits. Shift in zeros from the left.

Convert an `int32std/core/types/int32: V` to an `intstd/core/types/int: V` but interpret the `int32std/core/types/int32: V` as a 32-bit unsigned value.

Convert an `intstd/core/types/int: V` to `int32std/core/types/int32: V` but interpret the `int` as an unsigned 32-bit value. `i` is clamped between `0` and `0xFFFFFFFF`.
`0x7FFF_FFFF.uint32std/num/int32/uint32: (i : int) -> int32 == 0x7FFF_FFFF.int32 == max-int32std/num/int32/max-int32: int32`
`0x8000_0000.uint32std/num/int32/uint32: (i : int) -> int32 == -0x8000_0000.int32 == min-int32std/num/int32/min-int32: int32`
`0xFFFF_FFFF.uint32std/num/int32/uint32: (i : int) -> int32 == -1.int32`.

Truncated division (as in C). See also `(/):(x : int32std/core/types/int32: V, y : int32std/core/types/int32: V) -> int32std/core/types/int32: V`.

Truncated modulus (as in C). See also `(%):(x : int32std/core/types/int32: V, y : int32std/core/types/int32: V) -> int32std/core/types/int32: V`.

Take the bitwise xor of two `int32std/core/types/int32: V`s.