mirror of
https://github.com/sharkdp/bat.git
synced 2024-12-21 05:50:42 +01:00
6 lines
172 B
Rust
Vendored
6 lines
172 B
Rust
Vendored
// Output the square of a number.
|
|
fn print_square(num: f64) {
|
|
let result = f64::powf(num, 2.0);
|
|
println!("The square of {:.2} is {:.2}.", num, result);
|
|
}
|