> built-in type
int
methods of int values
in the browser
These are methods on integer and float values, available directly without importing a module. In each signature x is the value the method is called on: 3.min(5) calls min with x = 3 and y = 5. Wrap a negative literal in parentheses to call a method on it: (-5).abs().
Integer methods work on 64-bit signed values. A result that doesn't fit, such as 2.pow(70) or abs of the smallest i64, is a runtime error.
> methods
The value in lowercase hexadecimal without a 0x prefix: 255.to_hex() is "ff". A negative value is shown as its 64-bit two's complement: (-1).to_hex() is "ffffffffffffffff".
> examples
use std::io;
fn main() {
io::println("{}", (-5).abs());
io::println("{}", 255.to_hex());
io::println("{}", 3.14.floor());
}