LANGUAGE » RUST
Numbers
Methods
Method | Description |
---|---|
round | Round to nearest whole number. |
floor | Largest integer less than or equal to number. |
ceil | Smallest integer greater than or equal to number. |
trunc | Integer part without fractional digits. |
Example:
rust
let pi = 3.141592;
let round_pi = pi.round();