floor函数,其功能是“向下取整”,或者说“向下舍入”、“向零取舍”,即取不大于x的最大整数,与“四舍五入”不同,下取整是直接取按照数轴上最接近要求值的左边值,即不大于要求值的最大的那个整数值。
在C语言的函数库中,floor函数的语法如下:
#include<bits/stdc++.h>
using namespace std;
int main()
{
double a;
scanf("%lf",&a);
a=floor(a);
printf(“%lf",a);}
floor函数,其功能是“向下取整”,或者说“向下舍入”、“向零取舍”,即取不大于x的最大整数,与“四舍五入”不同,下取整是直接取按照数轴上最接近要求值的左边值,即不大于要求值的最大的那个整数值。
在C语言的函数库中,floor函数的语法如下:
#include<bits/stdc++.h>
using namespace std;
int main()
{
double a;
scanf("%lf",&a);
a=floor(a);
printf(“%lf",a);}
JAVA 对50取余数
ceil(n) 取大于等于数值n的最小整数floor(n)取小于等于数值n的最大整数
举报文章
请选择举报类型
补充说明
0/200
上传截图
格式支持JPEG/PNG/JPG,图片不超过1.9M