commit 1ffc9dd0d87329f78035a30496a24c336bfc223c
parent e4728864e280cc7b8fa1054b4194807323249f58
Author: Martin Kloeckner <mjkloeckner@gmail.com>
Date: Fri, 29 Mar 2024 01:39:26 -0300
Remove inclusion of `cmath` library
Replace `std::pow` with `x*x`
Diffstat:
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/solutions/ej24.cpp b/solutions/ej24.cpp
@@ -1,8 +1,7 @@
#include <iostream>
-#include <cmath>
bool cuadratic_has_real_roots(float a, float b, float c) {
- return (std::pow(b,2)-(4*a*c)) >= 0;
+ return ((b*b)-(4*a*c)) >= 0;
}
int main (void) {