Convert a boolean to an int32std/core/types/int32: V
.
Convert a pair (lostd/num/int32/lo: (i : int32) -> int32,histd/num/int32/hi: (i : int32) -> int32)
to a signed integer,
where (lostd/num/int32/lo: (i : int32) -> int32,histd/num/int32/hi: (i : int32) -> int32).int == histd/num/int32/hi: (i : int32) -> int32.int * 0x1_0000_0000 + lostd/num/int32/lo: (i : int32) -> int32.uint
.
Create an int32std/core/types/int32: V
from the give histd/num/int32/hi: (i : int32) -> int32
and lostd/num/int32/lo: (i : int32) -> int32
16-bit numbers.
Preserves the sign of histd/num/int32/hi: (i : int32) -> int32
.
Convert a pair (lostd/num/int32/lo: (i : int32) -> int32,histd/num/int32/hi: (i : int32) -> int32)
to an unsigned integer,
where (lostd/num/int32/lo: (i : int32) -> int32,histd/num/int32/hi: (i : int32) -> int32).uint == histd/num/int32/hi: (i : int32) -> int32.uint * 0x1_0000_0000 + lostd/num/int32/lo: (i : int32) -> int32.uint
.
Fold over the range [start,end]
(including end
).
Iterate over the range [start,end]
(including end
).
Executes action
for each integer between start
upto end
(including both start
and end
).
If start > end
the function returns without any call to action
.
If action
returns Juststd/core/types/Just: forall<a> (value : a) -> maybe<a>
, the iteration is stopped and the result returned.
Executes action
for each integer between start
upto end
(including both start
and end
).
If start > end
the function returns without any call to action
.
Are two 32-bit integers not equal?
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.
Add two 32-bit integers.
Subtract two 32-bit integers.
Euclidean-0 division.
Euclidean division is defined as: For any D
and d
where d!=0
, we have:
D == d*(D/d) + (D%d)
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 .
Is the first 32-bit integer smaller than the second?
Is the first 32-bit integer smaller or equal to the second?
Are two 32-bit integers equal?
Is the first 32-bit integer larger than the second?
Is the first 32-bit integer larger or equal to the second?
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.
Bit gather (also known as pext or parallel bit extract).
For each 1-bit in mask m
, extract the corresponding bit from i
and write it
into contiguous lower bits in the result. The remaining bits in the result are zero.
bgatherstd/num/int32/bgather: (i : int32, m : int32) -> int32(0x1234.int32, 0x0F0F.int32).show-hex == "0x24"
Here is how to decode a 4-byte utf-8 encoded character i
:
bgatherstd/num/int32/bgather: (i : int32, m : int32) -> int32(i,0x3F3F3F3F.int32)
.
The number of bits in an int32std/core/types/int32: V
(always 32).
Convert an int32std/core/types/int32: V
to a boolean.
Reverse the bits in an int32std/core/types/int32: V
.
Bit scatter (also known as pdep or parallel bit deposit).
For each 1-bit in mask m
, set the corresponding bit in the result from the
contiguous lower bits of i
. Any bits not set according to the mask are set to zero.
bscatterstd/num/int32/bscatter: (i : int32, m : int32) -> int32(0x1234.int32, 0x0F0F.int32).show-hex == "0x304"
.
Reverse the bytes in an 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
.
Count leading redundant sign bits (i.e. the number of bits following the most significant bit that are identical to it).
Count leading zero bits. Returns 32 if i
is zero.
Truncated modulus (as in C). See also (%):(x : int32std/core/types/int32: V, y : int32std/core/types/int32: V) -> int32std/core/types/int32: V
.
Count trailing zero bits. Returns 32 if i
is zero.
Decrement a 32-bit integer.
De-interleave the bits in i
such that the even bits are gathered in the
hi 16-bits of the result, and the odd bits in the lo 16-bits of the result.
Convert an 32-bit integer to a float64.
Fold over the 32-bit integers 0
to malformed identifier: a dash must be preceded by a letter or digit, and followed by a letter
.
Iterate over the 32-bit integers 0
to malformed identifier: a dash must be preceded by a letter or digit, and followed by a letter
.
Return the top 16-bits of an int32std/core/types/int32: V
.
Preserves the sign.
Convenient shorthand to int32
, e.g. 1234.i32std/num/int32/i32: (i : int) -> int32
.
Full 32x32 bit signed multiply to (histd/num/int32/hi: (i : int32) -> int32,lostd/num/int32/lo: (i : int32) -> int32)
.
where (histd/num/int32/hi: (i : int32) -> int32,lostd/num/int32/lo: (i : int32) -> int32).int == histd/num/int32/hi: (i : int32) -> int32.int * 0x1_0000_0000 + lostd/num/int32/lo: (i : int32) -> int32.uint
.
Increment a 32-bit integer.
Convert an int32std/core/types/int32: V
to an intstd/core/types/int: V
.
Convert an integer to an int32std/core/types/int32: V
. The number is clamped to the maximal or minimum int32std/core/types/int32: V
value if it is outside the range of an int32std/core/types/int32: V
.
Needed for control flow contexts in std/core/hnd
.
Interleave the hi 16-bits with the lo 16-bits of the argument i
such
that the hi bits are spread over the even bits and the lo bits over the odd bits of the result.
Returns true
if the integer i
is an even number.
Is the 32-bit integer negative?
Returns true
if the integer i
is an odd number.
Is the 32-bit integer positive (i.e. larger than zero)?
Is the 32-bit integer equal to zero?
Create a list with 32-bit integer elements from lostd/num/int32/lo: (i : int32) -> int32
to histd/num/int32/hi: (i : int32) -> int32
(including histd/num/int32/hi: (i : int32) -> int32
).
Return the low 16-bits of an int32std/core/types/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/types/int32: V
, i.e. flips all bits.
The 32-bit integer with value 1.
Take the bitwise or of two int32std/core/types/int32: V
s.
Or-combine: for every byte b
in the argument i
, the corresponding
byte in the result becomes 0 if b==0
, and 0xFF
otherwise.
Is the number of 1-bits even?
Count number of 1-bits (also known as population count or hamming weight).
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.
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).
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.
Compare the argument against zero.
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
.
Full 32x32 bit unsigned multiply to (histd/num/int32/hi: (i : int32) -> int32,lostd/num/int32/lo: (i : int32) -> int32)
.
where (histd/num/int32/hi: (i : int32) -> int32,lostd/num/int32/lo: (i : int32) -> int32).uint == histd/num/int32/hi: (i : int32) -> int32.uint * 0x1_0000_0000 + lostd/num/int32/lo: (i : int32) -> int32.uint
.
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.
The zero 32-bit integer.
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
.