double floor ( double x );
xの小数点以下を切り捨てた整数値。
x:小数点以下を切り捨てる倍精度浮動小数点値。
浮動小数点数の小数点以下を切り捨てた整数値を求め、double型にした値を返します。(床関数)
floor関数は、x以下の最大の整数値をdouble型の値として返す関数です。
〇PCベースコントローラ
〇InterMotion
void main() {
double x, y;
・・・・
x = 2.8;
y =floor(x); // 期待値 y=2.000000
Printf2("%f の floor は %f\n", x, y);
x = -2.8;
y = floor(x); // 期待値 y=-3.000000
Printf2("%f の floor は %f\n", x, y);
・・・・
}