Skip to main content

Timeline for answer to Python - round up to the nearest ten by Parker

Current License: CC BY-SA 4.0

Post Revisions

10 events
when toggle format what by license comment
May 17, 2023 at 14:25 history edited Parker CC BY-SA 4.0
Added small changes for Python 3
Feb 8, 2022 at 12:52 comment added Jeyekomon The expression math.ceil(x / 10) * 10 works just fine. No need for those conversions in recent versions of Python.
Dec 18, 2021 at 15:29 comment added sotmot It is more likely because you hit the eps and finite precision take over after that.
Nov 7, 2019 at 19:45 comment added Martin Hepp As far as I know, there is no longer a limit on the maximum size of an integer in Python, see here: daniweb.com/programming/software-development/threads/71008/…
Dec 11, 2017 at 1:09 comment added Parker I think that's because you're going past the python int limit
Nov 13, 2017 at 18:55 comment added Jaakko Seppälä That does not work always: If x = 1000000000000000010 then print(int(math.ceil(x / 10.0)) * 10) outputs 1000000000000000000.
Oct 29, 2015 at 19:15 history edited Parker CC BY-SA 3.0
Link to math.ceil() documentation
Oct 19, 2014 at 22:09 vote accept raspberrysupreme
Oct 19, 2014 at 20:12 vote accept raspberrysupreme
Oct 19, 2014 at 20:15
Oct 19, 2014 at 19:58 history answered Parker CC BY-SA 3.0