Hi,
I try to round a number, either up or down, so I always get a odd number.
Appreciated if someone could help.
Hi,
I try to round a number, either up or down, so I always get a odd number.
Appreciated if someone could help.
For up: odd num = num - (num % 2 - 1).
For down: odd num = num + (num % 2 - 1).
num % 2 will be 0 for evens and 1 for odds.
got it. thank you.