Added packReal function. (TODO: need to handle +/-Inf and NaN)