aboutsummaryrefslogtreecommitdiff
path: root/src/utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils.c')
-rw-r--r--src/utils.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/utils.c b/src/utils.c
index 3fe2e23..30a6e34 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -112,4 +112,9 @@ void matrix_vector_show(const gsl_matrix *m, const gsl_vector *v, const char *pr
}
+int sign(double a) {
+ if ( a < 0 ) return -1;
+ if ( a > 0 ) return +1;
+ return 0;
+}