From edce6d699ea3748370ff9fdc7f3dc048aaffc7d0 Mon Sep 17 00:00:00 2001 From: flatmush Date: Thu, 24 Feb 2011 16:48:57 +0000 Subject: Fixed an obvious bug, error was reported at 65536 times the correct value, real value for error is between 0.0060% and 0.0085%. Changed default values to more sensible ones, though iter will need to be lowered if run on an embedded environment. --- fixtest/fixtest.depend | 2 +- fixtest/main.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'fixtest') diff --git a/fixtest/fixtest.depend b/fixtest/fixtest.depend index 92b569d..ca1a110 100644 --- a/fixtest/fixtest.depend +++ b/fixtest/fixtest.depend @@ -1,5 +1,5 @@ # depslib dependency file v1.0 -1298564214 source:g:\vrfx\libfixmath\fixtest\main.c +1298565766 source:g:\vrfx\libfixmath\fixtest\main.c diff --git a/fixtest/main.c b/fixtest/main.c index 4c99381..b8e1146 100644 --- a/fixtest/main.c +++ b/fixtest/main.c @@ -53,8 +53,8 @@ int main(int argc, char** argv) { printf("Floating Point: %08"PRIuHICLOCK" @ %"PRIu32"Hz\n", flt_duration, HICLOCKS_PER_SEC); printf("Fixed Point: %08"PRIuHICLOCK" @ %"PRIu32"Hz\n", fix_duration, HICLOCKS_PER_SEC); - printf("Difference: %08"PRIiHICLOCK" (% 3.2f%%)\n", (flt_duration - fix_duration), ((fix_duration * 100.0) / flt_duration)); - printf("Error: % 3.2f%%\n", ((double)fix_error / iter)); + printf("Difference: %08"PRIiHICLOCK" (% 3.2f%)\n", (flt_duration - fix_duration), ((fix_duration * 100.0) / flt_duration)); + printf("Error: %f%%\n", ((fix16_to_dbl(fix_error) * 100.0) / iter)); return EXIT_SUCCESS; } -- cgit v1.2.3