Skip to content
Snippets Groups Projects
Commit e4d0304b authored by Tomasz Grabiec's avatar Tomasz Grabiec Committed by Pekka Enberg
Browse files

tests: Convert 'total' to double instead of float


Now that total is long casting to float may cause precision loss.

Signed-off-by: default avatarTomasz Grabiec <tgrabiec@cloudius-systems.com>
Signed-off-by: default avatarPekka Enberg <penberg@cloudius-systems.com>
parent be73a7d2
No related branches found
No related tags found
No related merge requests found
...@@ -86,7 +86,7 @@ int main(int argc, char const *argv[]) ...@@ -86,7 +86,7 @@ int main(int argc, char const *argv[])
_stat_printer.stop(); _stat_printer.stop();
auto actual_test_duration = to_seconds(test_end - test_start); auto actual_test_duration = to_seconds(test_end - test_start);
printf("Wrote %.3f MB in %.2f s = %.3f Mb/s\n", (float) total / MB, actual_test_duration, printf("Wrote %.3f MB in %.2f s = %.3f Mb/s\n", (double) total / MB, actual_test_duration,
(float) total / MB / actual_test_duration); (double) total / MB / actual_test_duration);
return 0; return 0;
} }
\ No newline at end of file
...@@ -78,8 +78,8 @@ int main(int argc, char const *argv[]) ...@@ -78,8 +78,8 @@ int main(int argc, char const *argv[])
_stat_printer.stop(); _stat_printer.stop();
auto actual_test_duration = to_seconds(test_end - test_start); auto actual_test_duration = to_seconds(test_end - test_start);
printf("Wrote %.3f MB in %.2f s = %.3f Mb/s\n", (float) total / MB, actual_test_duration, printf("Wrote %.3f MB in %.2f s = %.3f Mb/s\n", (double) total / MB, actual_test_duration,
(float)total / MB / actual_test_duration); (double) total / MB / actual_test_duration);
printf("\n"); printf("\n");
print_distribution(samples); print_distribution(samples);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment