Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. Python
  3. Question
Python

Why do Python's math.ceil() and math.floor() operations return floats instead of integers?

Asked by Helena Smith Sep 21, 2025 1.6K views 1 answer
Share

About this question

How do Python’s math.ceil() and math.floor() functions work, and why do they return floats instead of integers? This design choice might seem unusual, but it ensures consistency across Python’s math module, which primarily deals with floating-point numbers.

Your answer

1 Answer

More Python discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest Python Blogs

Guides, tips and career advice on Python from JanBask experts.