From: nsz Date: Thu, 12 Apr 2012 13:09:43 +0000 (+0200) Subject: strtod: add two simple benchmarks X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=90d36a676a6889339245d3143ce0cd7da3b705d8;p=libc-test strtod: add two simple benchmarks --- diff --git a/src/stdlib/strtod.c b/src/stdlib/strtod.c index 5ecd9ff..49766ea 100644 --- a/src/stdlib/strtod.c +++ b/src/stdlib/strtod.c @@ -170,3 +170,25 @@ void test_strtof() error("strtof(\"%s\") want %a got %a\n", tf[i].s, tf[i].f, x); } } + +void bench_strtod(int N) +{ + volatile double y; + char *p; + int i; + + for (i = 0; i < N; i++) + y = strtod("2740037.230228005325852424697698331177377e-7", &p); +} + + +void bench_strtold_big(int N) +{ + volatile long double y; + char *p; + int i; + + for (i = 0; i < N; i++) + y = strtold("118973149535723176505351158982948.86679662540046955672e4900", &p); +} +