floor函数,其功能是“向下取整”,或者说“向下舍入”、“向零取舍”,即取不大于x的最大整数,与“四舍五入”不同,下取整是直接取按照数轴上最接近要求值的左边值,即不大于要求值的最大的那个整数值。 

在C语言的函数库中,floor函数的语法如下:

#include<bits/stdc++.h>
using namespace std;
int main()
{
	double a;
	scanf("%lf",&a);
	a=floor(a);
printf(“%lf",a);}