Exponentiation of f32 possible?

Is there a method to do f32 exponentation in rust?
For example 5.24^2

fn main() {
    let x = 5.2;
    let n = 2;
    let y = x.pow(n);
}

Use either powi() or powf().

2 Likes

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.