Fix noise() generating NaN when called with a value larger than INT_MAX

I'm not happy with this fix though, it's slower and this is a pretty performance critical function. Maybe someone has an idea on how to solve this better? Or maybe it doesn't even need to be solved?