From d2c867f02e0abf5123df39c1e537123bd2c650ba Mon Sep 17 00:00:00 2001 From: Krishna Vedala <7001608+kvedala@users.noreply.github.com> Date: Sun, 16 Aug 2020 21:53:56 -0400 Subject: [PATCH] replace fabs with fabsf --- geometry/quaternions.c | 8 ++++---- geometry/vectors_3d.c | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/geometry/quaternions.c b/geometry/quaternions.c index 5537fec7..2e95923a 100644 --- a/geometry/quaternions.c +++ b/geometry/quaternions.c @@ -160,10 +160,10 @@ static void test() printf("Quaternion: %.4g %+.4g %+.4g %+.4g\n", test_quat.w, test_quat.dual.x, test_quat.dual.y, test_quat.dual.z); - assert(fabs(test_quat.w - quat.w) < .01); - assert(fabs(test_quat.q1 - quat.q1) < .01); - assert(fabs(test_quat.q2 - quat.q2) < .01); - assert(fabs(test_quat.q3 - quat.q3) < .01); + assert(fabsf(test_quat.w - quat.w) < .01); + assert(fabsf(test_quat.q1 - quat.q1) < .01); + assert(fabsf(test_quat.q2 - quat.q2) < .01); + assert(fabsf(test_quat.q3 - quat.q3) < .01); } int main() diff --git a/geometry/vectors_3d.c b/geometry/vectors_3d.c index 17be64f1..343a57d7 100644 --- a/geometry/vectors_3d.c +++ b/geometry/vectors_3d.c @@ -206,21 +206,21 @@ static void test() d = vector_norm(&a); // printf("|a| = %.4g\n", d); - assert(fabs(d - 3.742) < 0.01); + assert(fabsf(d - 3.742) < 0.01); d = vector_norm(&b); // printf("|b| = %.4g\n", d); - assert(fabs(d - 1.732) < 0.01); + assert(fabsf(d - 1.732) < 0.01); d = dot_prod(&a, &b); // printf("Dot product: %f\n", d); - assert(fabs(d - 6.f) < 0.01); + assert(fabsf(d - 6.f) < 0.01); vec_3d c = vector_prod(&a, &b); // printf("Vector product "); // printf("%s", print_vector(&c, "c")); - assert(fabs(c.x - (-1)) < 0.01); - assert(fabs(c.y - (2)) < 0.01); - assert(fabs(c.z - (-1)) < 0.01); + assert(fabsf(c.x - (-1)) < 0.01); + assert(fabsf(c.y - (2)) < 0.01); + assert(fabsf(c.z - (-1)) < 0.01); } /**