How to combine fload up into the next odd integer? I found how this can be done for even numbers here . So I tried something like:
import numpy as np
def round_up_to_odd(f):
return np.ceil(f / 2.) * 2 + 1
But of course, this does not round it to an NEXT odd number:
>>> odd(32.6)
35.0
Any suggestions?
source
share