The Python Oracle

Why does integer division yield a float instead of another integer?

Become part of the top 3% of the developers by applying to Toptal https://topt.al/25cXVn

--

Music by Eric Matyas
https://www.soundimage.org
Track title: Realization

--

Chapters
00:00 Question
00:47 Accepted answer (Score 326)
01:05 Answer 2 (Score 73)
01:21 Answer 3 (Score 55)
02:01 Answer 4 (Score 25)
03:40 Thank you

--

Full question
https://stackoverflow.com/questions/1282...

Question links:
[How can I force division to be floating point? Division keeps rounding down to 0?]: https://stackoverflow.com/questions/1267...

Accepted answer links:
[PEP-238]: http://www.python.org/dev/peps/pep-0238/

Answer 4 links:
[PEP 238]: https://www.python.org/dev/peps/pep-0238/

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#python #integer #python3x #division

#avk47