c++ portable conversion of long to double
问题 I need to accurately convert a long representing bits to a double and my soluton shall be portable to different architectures (being able to be standard across compilers as g++ and clang++ woulf be great too). I'm writing a fast approximation for computing the exp function as suggested in this question answers. double fast_exp(double val) { double result = 0; unsigned long temp = (unsigned long)(1512775 * val + 1072632447); /* to convert from long bits to double, but must check if they have