Int16
Definitions
Returns the absolute value of x.
If the absolute value exceeds maxValue(), -1 is returned.
Returns the number of one-bits in the two's complement binary
representation of x.
Convert x to an Int8.
Returns x clamped within the Int8 range min to max.
Returns x with the bit at position pos cleared (to 0).
Considers the 5 rightmost bits of pos (pos modulo 32).
The bits of x have positions: 0 (rightmost bit) - 15 (leftmost bit)
Returns 1 if x > y, -1 if x < y, and 0 if x = y. The sign of x - y.
Returns the distance between x and y.
If this distance exceeds maxValue(), -1 is returned.
Returns x with the bit at position pos flipped.
Considers the 5 rightmost bits of pos (pos modulo 32).
The bits of x have positions: 0 (rightmost bit) - 15 (leftmost bit)
Parse the string s as an Int16, leading or trailing whitespace is trimmed.
A successful parse is wrapped with Some(x), a parse failure is indicated by None.
Returns the bit of x at pos (either 0 or 1).
Considers the 5 rightmost bits of pos (pos modulo 32).
The bits of x have positions: 0 (rightmost bit) - 15 (leftmost bit)
Returns a value with at most a single one-bit, in the position
of the highest-order/leftmost one-bit in x.
Returns 0 if x=0.
Returns the position of the highest-order/leftmost one-bit in x.
Possible return values: 0 (rightmost bit) - 15 (leftmost bit)
-1 if x = 0
Returns the integer binary logarithm of x.
If the given value is 0 or negative, 0 is returned.
Returns the logical right shift of x by distance.
Only the rightmost 5 bits of distance are considered (ie. distance rem 32).
A zero is shifted into the leftmost position regardless of sign extension.
Returns a value with at most a single one-bit, in the position
of the highest-order/leftmost one-bit in x.
Returns 0 if x=0.
Returns the position of the lowest-order/rightmost one-bit in x.
Possible return values: 0 (rightmost bit) - 15 (leftmost bit)
-1 if x = 0
Returns the Euclidean modulo of x and n.
The result is always non-negative.
Returns the number of zero bits preceding the
highest-order/leftmost one-bit in x.
Returns 16 if x=0.
Returns the number of zero bits following the
lowest-order/rightmost one-bit in x.
Returns 16 if x=0.
Returns the remainder of x / n.
The result can be negative.
See also Int16.modulo.
Returns the value obtained by reversing the bits in the
two's complement binary representation of x.
Returns the value obtained by rotating the two's complement
binary representation of x left by distance bits.
Returns the value obtained by rotating the two's complement
binary representation of x right by distance bits.
Returns x with the bit at position pos set (to 1).
Considers the 5 rightmost bits of pos (pos modulo 32).
The bits of x have positions: 0 (rightmost bit) - 15 (leftmost bit)
Get the primitive Int16 value from its object representation (i.e. Short).
This function is expected to be used when marshaling Int16s from Java. Generally in Flix
code you should not need to use Short.
Convert x to a BigDecimal.
The numeric value of x is preserved exactly.
Convert x to a BigInt.
The numeric value of x is preserved exactly.
Convert x to a Float32.
The numeric value of x is preserved exactly.
Convert x to a Float64.
The numeric value of x is preserved exactly.
Convert x to a Int32.
The numeric value of x is preserved exactly.
Convert x to a Int64.
The numeric value of x is preserved exactly.
Convert x to an Int8 by truncation.
Discards all but the lowest 8 bits.
Convert x to an Option[Int8].
Returns Some(x as Int8) if the numeric value of x can be represented exactly.
Returns None if the numeric value of x is outside the range of Int8
(i.e. -128 to 127).