Ceiling and Floor Function Calculator
Find the floor, ceiling, nearest integer, fractional part and distance to each neighboring integer for any decimal, fraction, or named constant (pi, e, phi, √2, √3, √5).
Input
A decimal (-2.75), a fraction (7/3), or a constant: pi, e, phi, sqrt2, sqrt3, sqrt5.
Output
| Property | Value |
|---|---|
| No data yet | |
More ways to use this tool
REST API
curl -X POST https://api.iotools.cloud/v1/tool/ceiling-and-floor-function-calculator \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"value": "7/3"
}'Swap in your own key from your account. The tool's fields are the body — no wrapper.
Ask an AI agent
Use the IOTools `ceiling-and-floor-function-calculator` tool (Ceiling and Floor Function Calculator) on this input:
YOUR_INPUT_HEREPaste this at any agent connected to the IOTools MCP server, then add your input.
Embed widget
<iframe
src="https://iotools.cloud/embed/ceiling-and-floor-function-calculator/"
width="100%" height="520" frameborder="0" scrolling="no" loading="lazy"
title="Ceiling and Floor Function Calculator — iotools.cloud"
sandbox="allow-scripts allow-forms allow-same-origin allow-downloads allow-popups allow-popups-to-escape-sandbox"
allow="clipboard-write"
style="width:100%;border:1px solid #e5e7eb;border-radius:12px;overflow:hidden"></iframe>
<script src="https://iotools.cloud/embed.js" async></script>Drop this into your own page — free, no key required, just a link back.
| Cost per API/MCP call | From 5 credits |
|---|---|
| Need more credits? | View pricing |
Also available with
Guides
The floor function ⌊x⌋ rounds down to the nearest integer; the ceiling function ⌈x⌉ rounds up. This calculator computes both — plus the nearest integer, the fractional part, and how far your value sits from each neighboring integer — for a decimal, a fraction, or a named constant.
Supported inputs
Decimal -2.75
Fraction 7/3
Constants pi, e, phi, sqrt2, sqrt3, sqrt5Worked example: 7/3 ≈ 2.33333 has a floor of 2, a ceiling of 3, and a fractional part of about 0.333333 — the distance up to the ceiling (0.666667) is twice the distance down to the floor.
How it works
Floor ⌊x⌋ = greatest integer ≤ x
Ceiling ⌈x⌉ = smallest integer ≥ x
Fractional part = x − ⌊x⌋ (always between 0 and 1, even for negative x)For a negative value like -2.75, the floor is -3 (not -2) — floor always rounds down, toward negative infinity, never toward zero.
How to use it
- Enter a decimal, a fraction (
numerator/denominator), or a constant name. - Floor, ceiling, nearest integer, fractional part, and the distance to each neighboring integer update instantly.
FAQ
Why is the floor of -2.75 equal to -3, not -2? Floor means "round down toward negative infinity," not "drop the decimal part." -3 is less than -2.75, while -2 is greater than it — so -3 is the floor.
What counts as the fractional part of a negative number?
It's always x − ⌊x⌋, which stays between 0 and 1 regardless of sign — for -2.75 that's -2.75 − (-3) = 0.25, not -0.75.
Can I enter a negative fraction?
Yes — both the numerator and the whole fraction can be negative (e.g. -7/3 or 7/-3).
How is "nearest integer" different from rounding I learned in school? It follows standard rounding (ties round toward positive infinity) — for a value exactly halfway between two integers like 2.5, the nearest integer is 3.
Privacy
Everything runs locally in your browser — the value you enter is never uploaded or stored anywhere.