Round a value to nearest number divisible by 2, 4, 8 and 16?
What about int( 16 * round( value / 16. ))
?
If a number is divisible by 16, then it is divisible by 2, 4 and 8. Knowing this, just compute the modulo 16 remainder of the decimal number and substract it from the base number.
>>>> 1443.609022556391 - (1443.609022556391 % 16)
1440.0