Loading mysql-test/r/type_float.result +1 −1 Original line number Diff line number Diff line Loading @@ -274,7 +274,7 @@ a double 0 drop table t1,t2,t3; select 1e-308, 1.00000001e-300, 100000000e-300; 1e-308 1.00000001e-300 100000000e-300 0 1.00000001e-300 1e-292 1e-308 1.00000001e-300 1e-292 select 10e307; 10e307 1e+308 Loading strings/strtod.c +4 −16 Original line number Diff line number Diff line Loading @@ -31,7 +31,6 @@ #define MAX_DBL_EXP 308 #define MAX_RESULT_FOR_MAX_EXP 1.7976931348623157 #define MIN_RESULT_FOR_MIN_EXP 2.225073858507202 static double scaler10[] = { 1.0, 1e10, 1e20, 1e30, 1e40, 1e50, 1e60, 1e70, 1e80, 1e90 }; Loading Loading @@ -161,28 +160,17 @@ double my_strtod(const char *str, char **end_ptr, int *error) order= exp + (neg_exp ? -1 : 1) * (ndigits - 1); if (order < 0) order= -order; if (order >= MAX_DBL_EXP && result) if (order >= MAX_DBL_EXP && !neg_exp && result) { double c; /* Compute modulus of C (see comment above) */ c= result / scaler * 10.0; if (neg_exp) { if (order > MAX_DBL_EXP || c < MIN_RESULT_FOR_MIN_EXP) { result= 0.0; goto done; } } else { if (order > MAX_DBL_EXP || c > MAX_RESULT_FOR_MAX_EXP) { overflow= 1; goto done; } } } exp= tmp_exp; if (exp < 0) Loading Loading
mysql-test/r/type_float.result +1 −1 Original line number Diff line number Diff line Loading @@ -274,7 +274,7 @@ a double 0 drop table t1,t2,t3; select 1e-308, 1.00000001e-300, 100000000e-300; 1e-308 1.00000001e-300 100000000e-300 0 1.00000001e-300 1e-292 1e-308 1.00000001e-300 1e-292 select 10e307; 10e307 1e+308 Loading
strings/strtod.c +4 −16 Original line number Diff line number Diff line Loading @@ -31,7 +31,6 @@ #define MAX_DBL_EXP 308 #define MAX_RESULT_FOR_MAX_EXP 1.7976931348623157 #define MIN_RESULT_FOR_MIN_EXP 2.225073858507202 static double scaler10[] = { 1.0, 1e10, 1e20, 1e30, 1e40, 1e50, 1e60, 1e70, 1e80, 1e90 }; Loading Loading @@ -161,28 +160,17 @@ double my_strtod(const char *str, char **end_ptr, int *error) order= exp + (neg_exp ? -1 : 1) * (ndigits - 1); if (order < 0) order= -order; if (order >= MAX_DBL_EXP && result) if (order >= MAX_DBL_EXP && !neg_exp && result) { double c; /* Compute modulus of C (see comment above) */ c= result / scaler * 10.0; if (neg_exp) { if (order > MAX_DBL_EXP || c < MIN_RESULT_FOR_MIN_EXP) { result= 0.0; goto done; } } else { if (order > MAX_DBL_EXP || c > MAX_RESULT_FOR_MAX_EXP) { overflow= 1; goto done; } } } exp= tmp_exp; if (exp < 0) Loading