std/num/int32▲toc

32-bit signed integers.

.

fun (!=)( int32std/core/types/int32: V, int32std/core/types/int32: V ) : boolstd/core/types/bool: V
fun (%)( x : int32std/core/types/int32: V, y : int32std/core/types/int32: V ) : int32std/core/types/int32: V

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.

fun (*)( int32std/core/types/int32: V, int32std/core/types/int32: V ) : int32std/core/types/int32: V

Multiply two 32-bit integers.

fun (+)( int32std/core/types/int32: V, int32std/core/types/int32: V ) : int32std/core/types/int32: V
fun (-)( int32std/core/types/int32: V, int32std/core/types/int32: V ) : int32std/core/types/int32: V
fun (/)( x : int32std/core/types/int32: V, y : int32std/core/types/int32: V ) : int32std/core/types/int32: V

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:

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 .

fun (<)( int32std/core/types/int32: V, int32std/core/types/int32: V ) : boolstd/core/types/bool: V
fun (<=)( int32std/core/types/int32: V, int32std/core/types/int32: V ) : boolstd/core/types/bool: V
fun (==)( int32std/core/types/int32: V, int32std/core/types/int32: V ) : boolstd/core/types/bool: V
fun (>)( int32std/core/types/int32: V, int32std/core/types/int32: V ) : boolstd/core/types/bool: V
fun (>=)( int32std/core/types/int32: V, int32std/core/types/int32: V ) : boolstd/core/types/bool: V
fun (^)( int32std/core/types/int32: V, int32std/core/types/int32: V ) : int32std/core/types/int32: V

Take the bitwise xor of two int32std/core/types/int32: Vs.

fun (~)( i : int32std/core/types/int32: V ) : totalstd/core/total: E int32std/core/types/int32: V

Negate an 32-bit integer.

fun abs( i : int32std/core/types/int32: V ) : exnstd/core/exn: HX int32std/core/types/int32: V

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).

fun abs0( i : int32std/core/types/int32: V ) : int32std/core/types/int32: V

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).

fun and( int32std/core/types/int32: V, int32std/core/types/int32: V ) : int32std/core/types/int32: V

Take the bitwise and of two int32std/core/types/int32: Vs.

val bits-int32: int32std/core/types/int32: V

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

fun bool( i : int32std/core/types/int32: V ) : boolstd/core/types/bool: V

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

fun cdiv( i : int32std/core/types/int32: V, j : int32std/core/types/int32: V ) : exnstd/core/exn: HX int32std/core/types/int32: V

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

fun cmod( i : int32std/core/types/int32: V, j : int32std/core/types/int32: V ) : exnstd/core/exn: HX 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.

fun compare( x : int32std/core/types/int32: V, y : int32std/core/types/int32: V ) : orderstd/core/types/order: V
fun dec( i : int32std/core/types/int32: V ) : int32std/core/types/int32: V

Decrement a 32-bit integer.

fun divmod( x : int32std/core/types/int32: V, y : int32std/core/types/int32: V ) : (int32std/core/types/int32: V, int32std/core/types/int32: V)
fun double( int32std/core/types/int32: V ) : doublestd/core/types/double: V

Convert an 32-bit integer to a double.

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
fun inc( i : int32std/core/types/int32: V ) : int32std/core/types/int32: V

Increment a 32-bit integer.

fun int32( doublestd/core/types/double: V ) : int32std/core/types/int32: V

Convert a doublestd/core/types/double: V to an int32std/core/types/int32: V. The double is clamped to the minimum or maximum int32std/core/types/int32: V value if it is outside the range. A nan is mapped to 0.

fun int32( b : boolstd/core/types/bool: V ) : int32std/core/types/int32: V

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

fun is-even( i : int32std/core/types/int32: V ) : boolstd/core/types/bool: V

Returns true if the integer i is an even number.

fun is-neg( i : int32std/core/types/int32: V ) : boolstd/core/types/bool: V
fun is-odd( i : int32std/core/types/int32: V ) : boolstd/core/types/bool: V

Returns true if the integer i is an odd number.

fun is-pos( i : int32std/core/types/int32: V ) : boolstd/core/types/bool: V
fun is-zero( i : int32std/core/types/int32: V ) : boolstd/core/types/bool: V
fun max( i : int32std/core/types/int32: V, j : int32std/core/types/int32: V ) : int32std/core/types/int32: V

Return the maximum of two integers.

val max-int32: int32std/core/types/int32: V

The maximal integer value before overflow happens.

fun min( i : int32std/core/types/int32: V, j : int32std/core/types/int32: V ) : int32std/core/types/int32: V

Return the minimum of two integers.

val min-int32: int32std/core/types/int32: V

The minimal integer value before underflow happens.

fun negate( i : int32std/core/types/int32: V ) : int32std/core/types/int32: V

Negate a 32-bit integer.

fun not( i : int32std/core/types/int32: V ) : int32std/core/types/int32: V

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

val one: int32std/core/types/int32: V
fun or( int32std/core/types/int32: V, int32std/core/types/int32: V ) : int32std/core/types/int32: V

Take the bitwise or of two int32std/core/types/int32: Vs.

fun rotl( i : int32std/core/types/int32: V, n : int32std/core/types/int32: V ) : int32std/core/types/int32: V

Bitwise rotate an int32std/core/types/int32: V n & 31 bits to the left.

fun rotr( i : int32std/core/types/int32: V, n : int32std/core/types/int32: V ) : int32std/core/types/int32: V

Bitwise rotate an int32std/core/types/int32: V n & 31 bits to the right.

fun sar( int32std/core/types/int32: V, int32std/core/types/int32: V ) : int32std/core/types/int32: V

Arithmetic shift an int32std/core/types/int32: V to the right by n & 31 bits. Preserves the sign bit.

fun shl( int32std/core/types/int32: V, int32std/core/types/int32: V ) : int32std/core/types/int32: V

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

fun show( i : int32std/core/types/int32: V ) : stringstd/core/types/string: V

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.

fun shr( int32std/core/types/int32: V, int32std/core/types/int32: V ) : int32std/core/types/int32: V

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

fun sign( i : int32std/core/types/int32: V ) : orderstd/core/types/order: V
fun uint( i : int32std/core/types/int32: V ) : intstd/core/types/int: V

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.

fun uint32( i : intstd/core/types/int: V ) : int32std/core/types/int32: V

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.
0x7FFFFFFF.uint32std/num/int32/uint32: (i : int) -> int32 == 0x7FFFFFFF.int32 == max-int32std/num/int32/max-int32: int32
0x80000000.uint32std/num/int32/uint32: (i : int) -> int32 == -0x80000000.int32 == min-int32std/num/int32/min-int32: int32
0xFFFFFFFF.uint32std/num/int32/uint32: (i : int) -> int32 == -1.int32.

val zero: int32std/core/types/int32: V
private import std/core/typesstd/core/types, std/core/hndstd/core/hnd, std/corestd/core