C言語の数学関数のうちpow, sin, asin, abs, sqrt, exp, logについてfloat,double,long doubleの実行速度を比べてみた。出したのはdouble, long doubleの計算時間とfloatの計算時間の比。 生成する乱数の範囲が適当かどうかわからない。ご指摘大歓迎です。 /* * float, double, long doubleの数学関数の計算速度測定 */ #include<stdio.h> #include<stdlib.h> // rand, srand #include<math.h> #include<string.h> // strcpy #include<time.h> #include<sys/time.h> double elapsed(void) { struct timeval tp; struct timezo