Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR RUST

rust cube root

/// Options:
//  -> call the `cbrt()` function
//  -> call the `powf()` function with 1/3
//  
/// Example:
fn main() {
    let x = 2f64;               //  or f32
    let sqrt = &x.cbrt();       //  call sqrt()
    let sqrt2 = &x.powf(1/3);   //  call powf()
}
/// Note:
//  The second option can also be applied to other
//  roots. For the nth root it is then powf(1/n).
 
PREVIOUS NEXT
Tagged: #rust #cube #root
ADD COMMENT
Topic
Name
9+9 =