title | timestamp | author | published | description | tags | |
---|---|---|---|---|---|---|
Raise a number to a power in Rust |
2023-10-03 00:15:01 -0700 |
szabgab |
true |
Raise a number to a power |
|
We need to explicitely define the type of the base. We can do it by the type annotation : u128
or using the type suffix _u32
.
Then we use the pow
function.
{% include file="examples/raise-to-power/src/main.rs" %}