fn quadratic_mut(a: f64, b: f64, c: f64, x1: &mut f64, x2: &mut f64) -> bool {
    let discriminant = b * b - 4.0 * a * c;

    if discriminant < 0.0 {
        false
    } else {
        let root = compute_sqrt(discriminant);
        *x1 = (-b + root) / (2.0 * a);
        *x2 = (-b - root) / (2.0 * a);
        true
    }
}
/// solves the quadratic equation ax^2 + bx + c = 0
/// 
/// this function uses mutable references to "return" multiple values
///
/// # Arguments
/// * `a` - the a coefficient
/// * `b` - the b coefficient
/// * `c` - the c coefficient
/// * `solution1` - the address to store the first solution in
/// * `solution2` - the address to store the second solution in
///
/// # Returns
/// true if there is a solution, false if there is no solution
solves the quadratic equation ax^2 + bx + c = 0
this function uses mutable references to "return" multiple values
solves the quadratic equation ax^2 + bx + c = 0 this function uses mutable references to " return " multiple values
fn quadratic_mut(a: f64, b: f64, c: f64, x1: &mut f64, x2: &mut f64) -> bool {
    let discriminant = b * b - 4.0 * a * c;
    if discriminant < 0.0 {
        false
    } else {
        let root = compute_sqrt(discriminant);
        *x1 = (-b + root) / (2.0 * a);
        *x2 = (-b - root) / (2.0 * a);
        true
    }
}
fn quadratic_mut ( a : f64 , b : f64 , c : f64 , x1 : & mut f64 , x2 : & mut f64 ) -> bool { let discriminant = b * b - 4.0 * a * c ; if discriminant < 0.0 { false } else { let root = compute_sqrt ( discriminant ) ; * x1 = ( - b + root ) / ( 2.0 * a ) ; * x2 = ( - b - root ) / ( 2.0 * a ) ; true } }
solves the quadratic equation ax^2 + bx + c = 0
this function uses mutable references to "return" multiple values
solves the quadratic equation ax^2 + bx + c = 0 this function uses mutable references to " return " multiple values
a
f64
b
f64
c
f64
x1
&mut f64
x2
&mut f64
true if there is a solution, false if there is no solution
true if there is a solution false if there is no solution
a
f64
b
f64
c
f64
x1
&mut f64
x2
&mut f64