发布网友 发布时间:2022-04-24 02:40
共2个回答
热心网友 时间:2023-10-22 12:52
你可以用类Math中的round方法,
语法:
Math.round(<要四舍五入的数>);
注:“<要四舍五入的数>”为输入的数;
还可以自己创建四舍五入的函数,请看代码
希望能帮到你。
热心网友 时间:2023-10-22 12:53
double shu1 = 1/4;
double shu2 = (double)1/4;
其中shu1为0,shu2为0.25
热心网友 时间:2023-10-22 12:52
你可以用类Math中的round方法,
语法:
Math.round(<要四舍五入的数>);
注:“<要四舍五入的数>”为输入的数;
还可以自己创建四舍五入的函数,请看代码
希望能帮到你。
热心网友 时间:2023-10-22 12:52
你可以用类Math中的round方法,
语法:
Math.round(<要四舍五入的数>);
注:“<要四舍五入的数>”为输入的数;
还可以自己创建四舍五入的函数,请看代码
希望能帮到你。
热心网友 时间:2023-10-22 12:53
double shu1 = 1/4;
double shu2 = (double)1/4;
其中shu1为0,shu2为0.25
热心网友 时间:2023-10-22 12:52
你可以用类Math中的round方法,
语法:
Math.round(<要四舍五入的数>);
注:“<要四舍五入的数>”为输入的数;
还可以自己创建四舍五入的函数,请看代码
希望能帮到你。
热心网友 时间:2023-10-22 12:53
double shu1 = 1/4;
double shu2 = (double)1/4;
其中shu1为0,shu2为0.25
热心网友 时间:2023-10-22 12:53
double shu1 = 1/4;
double shu2 = (double)1/4;
其中shu1为0,shu2为0.25