aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniil Cherednik <dan.cherednik@gmail.com>2021-02-23 23:40:08 +0300
committerDaniil Cherednik <dan.cherednik@gmail.com>2021-02-23 23:40:08 +0300
commit8d6e37d2dc1680c4eabc70e2d6f29d72a6f641df (patch)
tree461be21b25ac48c96498ecf3580f47d6176fbfae
parentddaa6e43181634a4bce08f25ed5ecc0c9af94998 (diff)
downloadlibgha-8d6e37d2dc1680c4eabc70e2d6f29d72a6f641df.tar.gz
Fix warnings
-rw-r--r--src/sle.c2
-rw-r--r--test/common.h5
2 files changed, 4 insertions, 3 deletions
diff --git a/src/sle.c b/src/sle.c
index 328382a..aca65e8 100644
--- a/src/sle.c
+++ b/src/sle.c
@@ -19,7 +19,7 @@ int sle_solve(double *a, size_t n, double *x) {
max = fabs(a[col*k + k]);
index = k;
for (i = k + 1; i < n; i++) {
- t = abs(a[col * i + k]);
+ t = fabs(a[col * i + k]);
if (t > max) {
max = t;
index = i;
diff --git a/test/common.h b/test/common.h
index 2823df3..6757422 100644
--- a/test/common.h
+++ b/test/common.h
@@ -1,15 +1,16 @@
#include <stdio.h>
#include <stdlib.h>
+#include <stdint.h>
#include <string.h>
#include <math.h>
static inline int compare_phase(float a, float b, float delta) {
- if (abs(a - b) < delta)
+ if (fabs(a - b) < delta)
return 0;
a = fmod(a + M_PI, 2 * M_PI);
b = fmod(b + M_PI, 2 * M_PI);
// fprintf(stderr, "%f %f %f\n", a, b, delta);
- if (abs(a - b) < delta)
+ if (fabs(a - b) < delta)
return 0;
return -1;
}