f | def fix(n): | f | def fix(n): |
| | | |
n | def fixdec(f): | n | def dec(fun): |
| | | |
n | def newf(*args, **kwargs): | n | def newfun(*args, **kw): |
| args = list(args) | | args = list(args) |
| for i in range(len(args)): | | for i in range(len(args)): |
| if isinstance(args[i], float): | | if isinstance(args[i], float): |
| args[i] = round(args[i], n) | | args[i] = round(args[i], n) |
t | for k in kwargs: | t | for i in kw: |
| if isinstance(kwargs[k], float): | | if isinstance(kw[i], float): |
| kwargs[k] = round(kwargs[k], n) | | kw[i] = round(kw[i], n) |
| res = f(*tuple(args), **kwargs) | | a = fun(*args, **kw) |
| if isinstance(res, float): | | if isinstance(a, float): |
| res = round(res, n) | | a = round(a, n) |
| return res | | return a |
| return newf | | return newfun |
| return fixdec | | return dec |