楼层功能
下限总是向下舍入到负无穷大,这对于负数尤其重要。
舍入计算器
输入数字并选择您的舍入首选项
|
🪄 快速示例
📋 How It Works
它是如何运作的
1
Step 1
Choose the target precision or place value.
2
Step 2
Drop extra digits and move downward toward negative infinity.
3
Step 3
Return a value that is never greater than the original at that precision.
📊 Examples
工作示例
Examples highlight where floor and truncate differ on negatives.
| 输入 | 目标 | 方法 | 结果 |
|---|---|---|---|
| 2.99 | 最接近的整数 | 向下舍入(地板) | 2 |
| -2.01 | 最接近的整数 | 向下舍入(地板) | -3 |
| 12.309 | 最接近的百分之一 (2 dp) | 向下舍入(地板) | 12.30 |
温馨提示
常见错误
Avoid these frequent rounding errors when validating outputs.
- Treating floor as simple digit cut-off.
- Expecting floor to behave like nearest rounding.
- Using floor when toward-zero behavior is required.
- Ignoring sign when validating test results.
❓ 常见问题解答
常见问题解答
Is floor the same as truncate?
No. Floor moves toward negative infinity while truncate moves toward zero.
How does floor work for negatives?
Negative numbers become more negative whenever there is a remainder.
When is floor useful?
Floor is useful for conservative lower-bound calculations.
Can I compare floor and ceiling quickly?
Yes. Related links let you test the same inputs under both methods.