aiken/int

Functions

compare(left: Int, right: Int) -> Ordering

Compare two integers.

int.compare(14, 42) == Less
int.compare(14, 14) == Equal
int.compare(42, 14) == Greater

from_utf8(bytes: ByteArray) -> Option<Int>

Parse an integer from a utf-8 encoded ‘ByteArray’, when possible.

int.from_utf8("14") == Some(14)
int.from_utf8("-42") == Some(-42)
int.from_utf8("007") == Some(7)
int.from_utf8("foo") == None
int.from_utf8("1.0") == None
int.from_utf8("1-2") == None
Search Document