From: alegrand Date: Wed, 15 Dec 2004 06:14:07 +0000 (+0000) Subject: when using doubles, %lg should be used for scanf and %g for printf (which is X-Git-Tag: v3.3~4711 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/62f9057c5250b460384dd7d2e10d9b7bb2be3e5d?ds=sidebyside;hp=12d4b2676373746e2b576a761db494a695b3562b when using doubles, %lg should be used for scanf and %g for printf (which is weird because it means printf does not make any difference between float and double). However %lg also works for printf. So let's keep it uniform and we'll change that if we ever find a machine where it does not work. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@639 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/testsuite/surf/maxmin_bench.c b/testsuite/surf/maxmin_bench.c index d3123c8d20..08eb1ac6fa 100644 --- a/testsuite/surf/maxmin_bench.c +++ b/testsuite/surf/maxmin_bench.c @@ -75,7 +75,7 @@ int main(int argc, char **argv) date = gras_os_time() * 1000000; test(nb_cnst, nb_var, nb_elem); printf("One shot execution time for a total of %d constraints, " - "%d variables with %d active constraint each : %f microsecondes \n", + "%d variables with %d active constraint each : %lg microsecondes \n", nb_cnst, nb_var, nb_elem, date); return 0; } diff --git a/testsuite/surf/maxmin_usage.c b/testsuite/surf/maxmin_usage.c index 9a3b4e18c8..33f3213d29 100644 --- a/testsuite/surf/maxmin_usage.c +++ b/testsuite/surf/maxmin_usage.c @@ -11,7 +11,7 @@ #include #include "surf/maxmin.h" -#define PRINT_VAR(var) printf(#var " = %g\n",lmm_variable_getvalue(var)); +#define PRINT_VAR(var) printf(#var " = %lg\n",lmm_variable_getvalue(var)); /* */ /* ______ */ diff --git a/testsuite/xbt/heap_bench.c b/testsuite/xbt/heap_bench.c index 5f3e1c40cc..ea737a9478 100644 --- a/testsuite/xbt/heap_bench.c +++ b/testsuite/xbt/heap_bench.c @@ -70,7 +70,7 @@ void test_heap_mean_operation(int size) for (i = 0; i < size; i++) xbt_heap_push(heap, NULL, (10.0 * rand() / (RAND_MAX + 1.0))); date = gras_os_time() * 1000000 - date; - printf("Creation time %d size heap : %g\n", size, date); + printf("Creation time %d size heap : %lg\n", size, date); date = gras_os_time() * 1000000; for (j = 0; j < MAX_TEST; j++) { @@ -79,7 +79,7 @@ void test_heap_mean_operation(int size) xbt_heap_push(heap, NULL, 3.0 * val); } date = gras_os_time() * 1000000 - date; - printf("Mean access time for a %d size heap : %g\n", size, + printf("Mean access time for a %d size heap : %lg\n", size, date * 1.0 / (MAX_TEST + 0.0)); xbt_heap_free(heap);