1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

merge & simple cleanup

This commit is contained in:
unknown
2004-03-15 13:21:14 +02:00
5 changed files with 22 additions and 22 deletions

View File

@ -36,6 +36,11 @@ static double scaler1[] = {
1.0, 10.0, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9
};
#ifndef HUGE_VAL /* Should be +Infinitive */
#define HUGE_VAL DBL_MAX
#endif
double my_strtod(const char *str, char **end)
{
double result= 0.0;
@ -92,10 +97,10 @@ double my_strtod(const char *str, char **end)
}
if (exp >= 1000)
{
if (neg)
result= 0.0;
else
overflow=1;
if (neg)
result= 0.0;
else
overflow= 1;
goto done;
}
while (exp >= 100)
@ -115,10 +120,10 @@ done:
if (end)
*end = (char *)str;
if (overflow || ((overflow=isinf(result))))
if (overflow || isinf(result))
{
result=DBL_MAX;
errno=EOVERFLOW;
result= DBL_MAX;
errno= EOVERFLOW;
}
return negative ? -result : result;