Use (L)DBL_MAX_10_EXP and (L)DBL_MIN_10_EXP

Use the (L)DBL_MAX_10_EXP and (L)DBL_MIN_10_EXP instead of hard-coding
+/-310.

Thanks to Yury Vishnevskiy, who proposed this patch.