Skip to content

Commit

Permalink
Fix abs function
Browse files Browse the repository at this point in the history
Issue reported by Jamal
  • Loading branch information
jeanlucf22 committed Sep 15, 2023
1 parent d253071 commit f42567a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include "bml.h"
#include "prg_progress_mod.h"
#include <stdio.h>
#include <math.h>

int
main(
Expand Down Expand Up @@ -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);
}
}
Expand Down

0 comments on commit f42567a

Please sign in to comment.