I don't know how it's been like this the whole time!
Code: Select all
core::round32(1.5) = 2
core::round32(-1.5) = -1
It must be a bug if
Code: Select all
core::round32(-1.51) = -2
This is a fix for it (if I am correct and I can't see how I am not hehe)
Code: Select all
inline f32 round_( f32 x )
{
if (x < 0.f)
return - floorf( -x + 0.5f );
return floorf( x + 0.5f );
}