Skip to content

Latest commit

 

History

History
16 lines (12 loc) · 390 Bytes

raise-a-number-to-a-power.md

File metadata and controls

16 lines (12 loc) · 390 Bytes
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
pow

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" %}