Use unions in RNG to reduce casting overhead