add math/modf benchmark
authornsz <nsz@port70.net>
Wed, 28 Mar 2012 23:59:51 +0000 (01:59 +0200)
committernsz <nsz@port70.net>
Wed, 28 Mar 2012 23:59:51 +0000 (01:59 +0200)
src/math/modf.c

index 43b8657..8a5cc95 100644 (file)
@@ -88,3 +88,21 @@ void test_modfl()
                        error("modfl(%La) want %La %La got %La %La\n", tl[i].x, tl[i].yf, tl[i].yi, yf, yi);
        }
 }
+
+void bench_modf_small(int N)
+{
+       int i;
+       volatile double yf, yi;
+
+       for (i = 0; i < N; i++)
+               yf = modf(1234.5678, &yi);
+}
+
+void bench_modf_large(int N)
+{
+       int i;
+       volatile double yf, yi;
+
+       for (i = 0; i < N; i++)
+               yf = modf(1.2345678e300, &yi);
+}