redef fun to_i32 is intern
redef fun to_u32 is intern
+ # Returns `self` as a Char according to its ASCII value.
+ fun ascii: Char `{ return (uint32_t)self; `}
+
redef fun distance(i) do return (self - i).to_i
redef fun <=>(other)
redef fun *(i) is intern
redef fun /(i) is intern
+ # Returns `self` as a Char according to its ASCII value.
+ fun ascii: Char `{ return (uint32_t)self; `}
+
# Modulo of `self` with `i`.
#
# Returns the remainder of division of `self` by `i`.
redef fun zero do return 0.to_u16
redef fun value_of(val) do return val.to_u16
+ # Returns `self` as a Char according to its ASCII value.
+ fun ascii: Char `{ return (uint32_t)self; `}
+
# `i` bits shift to the left
#
# assert 5u16 << 1 == 10u16
redef fun *(i) is intern
redef fun /(i) is intern
+ # Returns `self` as a Char according to its ASCII value.
+ fun ascii: Char `{ return (uint32_t)self; `}
+
# Modulo of `self` with `i`.
#
# Returns the remainder of division of `self` by `i`.
redef fun *(i) is intern
redef fun /(i) is intern
+ # Returns `self` as a Char according to its ASCII value.
+ fun ascii: Char `{ return (uint32_t)self; `}
+
# Modulo of `self` with `i`.
#
# Returns the remainder of division of `self` by `i`.
# Removes the numeric head of `self` if present
#
- # intrude import standard::fixed_ints
+ # intrude import core::fixed_ints
# assert "0xFFEF".strip_numhead == "FFEF"
# assert "0o7364".strip_numhead == "7364"
# assert "0b01001".strip_numhead == "01001"
# Gets the numeric head of `self` if present
# Returns "" otherwise
#
- # intrude import standard::fixed_ints
+ # intrude import core::fixed_ints
# assert "0xFEFF".get_numhead == "0x"
# assert "0b01001".get_numhead == "0b"
# assert "0o872".get_numhead == "0o"
# Removes the numeric extension if present
#
- # intrude import standard::fixed_ints
+ # intrude import core::fixed_ints
# assert "0xFEFFu8".strip_numext == "0xFEFF"
# assert "0b01001u8".strip_numext == "0b01001"
# assert "0o872u8".strip_numext == "0o872"
# Gets the numeric extension (i/u 8/16/32) in `self` is present
# Returns "" otherwise
#
- # intrude import standard::fixed_ints
+ # intrude import core::fixed_ints
# assert "0xFEFFu8".get_numext == "u8"
# assert "0b01001u8".get_numext == "u8"
# assert "0o872u8".get_numext == "u8"