#include <stdio.h> #include <math.h> main() { double pi; pi = 3.14159265358979; printf("2の平方根 = %f\n", sqrt(2.0)); printf("cos(pi / 3.0) = %f\n", cos(pi / 3.0)); printf("sin(pi / 3.0) = %f\n", sin(pi / 3.0)); printf("tan(pi / 4.0) = %f\n", tan(pi / 4.0)); printf("log(10.0) = %f\n", log(10.0)); }
2の平方根 = 1.414214 cos(pi / 3.0) = 0.500000 sin(pi / 3.0) = 0.866025 tan(pi / 4.0) = 1.000000 log(10.0) = 2.302585