std/num/int32▲toc

Operations on 32-bit signed integers.

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

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

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: (int32, int32) -> int32(D,n) (with 0 <= n <= 31 and 2^n means 2 to the power of n ) D%(2n) == D (&)std/num/int32/(&): (int32, int32) -> int32 ((2n) - 1) (with 0 <= n <= 31 and 2^n means 2 to the power of n )
Note that an int32eresting edge case is minInt / -1 which equals minInt since in modulo 32-bit arithmetic minInt == -1 * minInt == -1 * (minInt / -1) + (minInt % -1) satisfying property (1). Of course (minInt + 1) / -1 is again positive (namely maxInt).
See also Division and modulus for computer scientists, Daan Leijen, 2001 for further information available at: http://​research.​microsoft.​com/​pubs/​151917/​divmodnote.​pdf .

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

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

Negate an 32-bit integer.

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

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

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

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

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

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

Decrement a 32-bit integer.

Convert an 32-bit integer to a double.

Returns true if the integer i is an even number.

Increment a 32-bit integer.

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

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

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/int32: V, i.e. flips all bits.

Returns true if the integer i is an odd number.

Bitwise rotate an int32std/core/int32: V n bits to the left. Does not rotate when n is negative.

Bitwise rotate an int32std/core/int32: V n bits to the right. Does not rotate when n is negative.

Arithmetic shift an int32std/core/int32: V to the right by n bits. Preserves the sign bit. Returns i when n is negative. When n >= bitsInt returns either -1 when i<0, or 0 when i>=0.

Shift an int32std/core/int32: V i to the left by n bits. Returns i when n is negative, or 0 when n >= bitsInt.

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

Show an int32std/core/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/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).

Show an int32std/core/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/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/int32: V to the right by n bits. Shift in zeros from the left. Returns i when n is negative, or 0 when n >= bitsInt.

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

Convert an intstd/core/int: V to int32std/core/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: int
0x80000000.uint32std/num/int32/uint32: (i : int) -> int32 == -1.int32
0xFFFFFFFF.uint32std/num/int32/uint32: (i : int) -> int32 == -0x80000000.int32 == min-int32std/num/int32/min-int32: int.

private import std/corestd/core