mirror of
https://github.com/ps2dev/mymc.git
synced 2024-11-11 22:17:10 +01:00
ddfa6a79f9
http://www.csclub.uwaterloo.ca:11068/mymc/ -updated to use Python 2.7 and Visual C++ 2008 runtime -add a rename command to the command line interface -a few minor bugs fixed
22 lines
299 B
Python
Executable File
22 lines
299 B
Python
Executable File
#
|
|
# round.py
|
|
#
|
|
# By Ross Ridge
|
|
# Public Domain
|
|
#
|
|
# Simple rounding functions.
|
|
#
|
|
|
|
_SCCS_ID = "@(#) mymc round.py 1.3 07/04/17 02:10:27\n"
|
|
|
|
def div_round_up(a, b):
|
|
return (a + b - 1) / b
|
|
|
|
def round_up(a, b):
|
|
return (a + b - 1) / b * b
|
|
|
|
def round_down(a, b):
|
|
return a / b * b
|
|
|
|
|