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.
This commit is contained in:
flatmush 2011-02-24 16:48:57 +00:00
parent d3482256c2
commit edce6d699e
2 changed files with 3 additions and 3 deletions

View File

@ -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
<stdio.h>
<stdlib.h>
<math.h>

View File

@ -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;
}