Welcome to OxRSE’s documentation!¶
The OxRSE Template Python Project is a tiny Python project, hosted on GitHub, that shows how various modern, free tools can be used to adhere to good software practice.
Calculating methods¶
-
oxrse.
add
(a, b)¶ Adds
a
andb
and returns the result.See also
subtract()
.
Rounding floating point numbers¶
-
class
oxrse.
FloatRounder
(round_towards_zero=False)¶ Rounds floating point numbers.
Two rounding modes are available: rounding to the nearest integer (default) and rounding towards zero (to enable set
round_towards_zero
toTrue
).-
round
(number)¶ Rounds the given
number
and returns the result (as a float).The method really doesn’t like rounding “1.23” or “2.34”, and will raise a
ValueError
if asked to do so.
-