roundFloatToInt is broken! WTF!

why in the name of all that is holy would roundFloatToInt() work fine in a Debug build but return NOTHING BUT ZEROS in me release build!!!

lost days tracking that bastard down!!! been up several extensive wrong trees.

replaced with cast and working good enough.

numbers going in were not wierd or anything. (EG 423.234)


The only time I saw it go wrong was in an old build on gcc, where it was getting optimised incorrectly. That’s why I changed it to use a union, which should be guaranteed to do the right thing. What platform are you on?

windows xp sp 2

juce in dll (dont ask!)

discrepency of build settings? optimizations?

I guess it could be a struct alignment issue - if the union it uses got misaligned then that could cause it. Would expect it to be the same in debug though.

right. sorted.

the juce.dll was using fp:precise and my .exe was using fp:fast

fair enough eh?

Ah, that’d explain it.