rsys

Basic data structures and low-level features
git clone git://git.meso-star.fr/rsys.git
Log | Files | Refs | README | LICENSE

commit d53aac114915485d762d01d6bc2d5cf231d1a666
parent 0813e79bb8f125e9ba12cb110da00f666994eb3c
Author: vaplv <vaplv@free.fr>
Date:   Fri, 19 Sep 2014 22:06:24 +0200

Fix a precision issue on the 32-bits math tests

Diffstat:
M.gitignore | 2+-
Msrc/math.h | 2+-
Msrc/test_math.c | 2+-
3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/.gitignore b/.gitignore @@ -3,7 +3,7 @@ CMakeCache.txt CMakeFiles Makefile tmp -[Bb]uild +[Bb]uild* *.sw[po] *.[ao] *~ diff --git a/src/math.h b/src/math.h @@ -55,7 +55,7 @@ log2i(const int i) return ((ucast.i>>23/*#bits mantissa*/) & ((1<<8/*#bits exponent*/)-1)) - 127; } -static FINLINE float +static NOINLINE float absf(const float flt) { union { float f; int32_t i; } ucast; diff --git a/src/test_math.c b/src/test_math.c @@ -76,7 +76,7 @@ main(int argc, char** argv) CHECK(absf(-1.f), 1.f); CHECK(absf(10.f), 10.f); - CHECK(absf(-3.14159f), 3.14159f); + CHECK(absf(-3.14159f), (float)3.14159f); CHECK(signf(-3.14159f), -1.f); CHECK(signf(1.23f), 1.f);