Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

math.floor(x / n) can be written x // n

It's worth noting that x//n returns an int and math.floor returns a float, so the statements aren't equivalent.



If you pass a float in as x or n, x // n will be a float.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: