Help for this page

Select Code to Download


  1. or download this
    use strict;
    use warnings;
    ...
        return if $root < 0;
        return -($b + (0 < $b ? 1 : -1) * sqrt($root)) / 2*$a;
    }
    
  2. or download this
    a = 4.000000, b = 8.000000, c = 3.000000: -24.000000
    a = 2.000000, b = 2.000000, c = 3.000000: No solution
    a = -1.000000, b = 2.000000, c = 8.000000: 4.000000