Função de piso
O piso sempre arredonda para baixo em direção ao infinito negativo, especialmente importante para números negativos.
Calculadora de arredondamento
Insira um número e escolha suas preferências de arredondamento
|
🪄 Exemplos rápidos
📋 How It Works
Como funciona
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
Exemplos trabalhados
Examples highlight where floor and truncate differ on negatives.
| Entrada | Alvo | Método | Resultado |
|---|---|---|---|
| 2.99 | Número inteiro mais próximo | Arredondar para baixo (piso) | 2 |
| -2.01 | Número inteiro mais próximo | Arredondar para baixo (piso) | -3 |
| 12.309 | Centésimo mais próximo (2 dp) | Arredondar para baixo (piso) | 12.30 |
Dicas
Erros Comuns
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.
❓ Perguntas frequentes
Perguntas frequentes
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.