From f42567a221354ee54d6b6977aaf7f7823cb16aad Mon Sep 17 00:00:00 2001 From: Jean-Luc Fattebert Date: Thu, 14 Sep 2023 21:21:00 -0400 Subject: [PATCH] Fix abs function Issue reported by Jamal --- tests/src/main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/src/main.c b/tests/src/main.c index eab6a7fa..c7649f45 100644 --- a/tests/src/main.c +++ b/tests/src/main.c @@ -3,6 +3,7 @@ #include "bml.h" #include "prg_progress_mod.h" #include +#include int main( @@ -154,9 +155,9 @@ main( bml_read_bml_matrix(ham, "hamiltonian_ortho.mtx"); prg_build_density_T_fermi(ham, rho, threshold, kbt, ef, 1, drho); - if (abs(drho - drho_ref) > 1.0e-5) + if (fabs(drho - drho_ref) > 1.0e-5) { - printf("Difference is too high %f %f\n", drho, drho_ref); + printf("Difference is too high %f\n", drho - drho_ref); exit(EXIT_FAILURE); } }