Floor Function Calculator
Calculate the greatest integer function ⌊x⌋ with step-by-step explanations
Calculate Floor Function
Enter any real number (positive, negative, or decimal)
Floor Function Result
Integer InputFloor Function Result:
⌊0⌋ = 0
The greatest integer less than or equal to 0
Comparison with Ceiling Function:
Floor ⌊x⌋
0
Round down
Ceiling ⌈x⌉
0
Round up
Mathematical Properties:
Integer Analysis:
Purple: Floor value | Green: ≤ x | Red: > x
Step-by-step Explanation:
Common Examples:
Positive Decimal
⌊21.3⌋ = 21
The greatest integer ≤ 21.3 is 21
Exact Integer
⌊7⌋ = 7
Since 7 is an integer, ⌊7⌋ = 7
Negative Decimal
⌊-1.3⌋ = -2
The greatest integer ≤ -1.3 is -2 (not -1!)
Zero
⌊0⌋ = 0
⌊0⌋ = 0
Pi
⌊3.141592653589793⌋ = 3
⌊π⌋ = ⌊3.14159...⌋ = 3
Large Negative
⌊-15.7⌋ = -16
The greatest integer ≤ -15.7 is -16
Floor Function Definition
⌊x⌋ = max{n ∈ ℤ : n ≤ x}
Greatest integer ≤ x
Also known as:
• Greatest Integer Function
• Integer Part Function
• Step Function
Notation: ⌊x⌋ or floor(x)
Key Properties
Range Constraint
x - 1 < ⌊x⌋ ≤ x
Step Function
Creates a step-like graph
Idempotent
⌊⌊x⌋⌋ = ⌊x⌋
Non-decreasing
x ≤ y ⟹ ⌊x⌋ ≤ ⌊y⌋
Quick Reference
Positive Numbers
Round down to integer
⌊3.7⌋ = 3
Negative Numbers
Round down (away from zero)
⌊-2.3⌋ = -3
Integers
Remain unchanged
⌊5⌋ = 5
vs Ceiling
⌊x⌋ ≤ x ≤ ⌈x⌉
⌊2.3⌋ = 2, ⌈2.3⌉ = 3
Understanding the Floor Function
What is the Floor Function?
The floor function ⌊x⌋ returns the greatest integer that is less than or equal to x. It's like asking: "What's the largest whole number that doesn't exceed my input?"
How to Calculate:
Step 1: Look at your number
Step 2: If it's an integer, that's your answer
Step 3: If not, find the nearest integer below it
Step 4: That's your floor value!
Common Mistakes
❌ Wrong for Negatives
⌊-2.3⌋ = -2 (incorrect)
⌊-2.3⌋ = -3 (correct)
✓ Think "Round Down"
Always round toward negative infinity
Graph Characteristics
• Step-like appearance
• Discontinuous at every integer
• Constant on intervals [n, n+1)
• Non-decreasing function
Mathematical Properties
Range Property
x - 1 < ⌊x⌋ ≤ x
The floor is always within 1 unit of the input
Idempotent
⌊⌊x⌋⌋ = ⌊x⌋
Applying floor twice gives the same result
Integer Addition
⌊x + n⌋ = ⌊x⌋ + n
Where n is any integer
Applications
Computer Science
- • Array indexing calculations
- • Integer division operations
- • Pagination algorithms
- • Time-based calculations
Mathematics
- • Number theory problems
- • Discrete mathematics
- • Rounding operations
- • Step function analysis