- 代码
double down = Math.Floor(77.5); //向下取整
double up = Math.Ceiling(77.5); //向上取整
MessageBox.Show("77.5向下取整是" + down+ "\n77.5向上取整是" + up);
- 运行结果
2022-02-01 18:45:04
double down = Math.Floor(77.5); //向下取整
double up = Math.Ceiling(77.5); //向上取整
MessageBox.Show("77.5向下取整是" + down+ "\n77.5向上取整是" + up);