diff options
| author | flatmush <flatmush@d3e1167c-abe1-51d5-8199-f9061ebe54e4> | 2011-02-24 16:48:57 +0000 |
|---|---|---|
| committer | flatmush <flatmush@d3e1167c-abe1-51d5-8199-f9061ebe54e4> | 2011-02-24 16:48:57 +0000 |
| commit | edce6d699ea3748370ff9fdc7f3dc048aaffc7d0 (patch) | |
| tree | 47a100d9c9fa20f5718ddc9f246bad14f2ee792d /fixtest | |
| parent | d3482256c277dff8cd6243dae0f72df1a4c676d3 (diff) | |
| download | libfixmath-edce6d699ea3748370ff9fdc7f3dc048aaffc7d0.tar.gz | |
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.
Diffstat (limited to 'fixtest')
| -rw-r--r-- | fixtest/fixtest.depend | 2 | ||||
| -rw-r--r-- | fixtest/main.c | 4 |
2 files changed, 3 insertions, 3 deletions
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
<stdio.h>
<stdlib.h>
<math.h>
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;
}
|
