myfloor

cosmo_utils.utils.stats_funcs.myfloor(x, base=10)[source] [edit on github]

Determines the lower-bound interger for a given number with a given base.

Parameters:

x : float

Number to be approximated to closest number to base

base : float

Base used to calculate the closest largest number

Returns:

y : float

Closest float number to x, i.e. upper-bound float

Examples

>>> myfloor(12, 10)
10.0
>>> myfloor(12.05, 1.)
12.0
>>> myfloor(12.05, 0.2)
12.0