Fungsi Lantai

Lantai sentiasa membundar ke bawah ke arah infiniti negatif, terutamanya penting untuk nombor negatif.

🔢
Kalkulator Pembundaran
Masukkan nombor dan pilih pilihan pembundaran anda
|
🪄 Contoh Pantas

Bagaimana Ia Berfungsi

1

Langkah 1

Choose the target precision or place value.

2

Langkah 2

Drop extra digits and move downward toward negative infinity.

3

Langkah 3

Return a value that is never greater than the original at that precision.

Contoh Kerja

Examples highlight where floor and truncate differ on negatives.

Input Sasaran Kaedah Hasilnya
2.99 Nombor Bulat Terdekat Bulat ke Bawah (Tingkat) 2
-2.01 Nombor Bulat Terdekat Bulat ke Bawah (Tingkat) -3
12.309 Perseratus Terhampir (2 dp) Bulat ke Bawah (Tingkat) 12.30

Kesilapan Biasa

Elakkan ralat pembundaran yang kerap ini semasa mengesahkan output.

  • 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.

Soalan Lazim

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.