mirror of
https://github.com/postgres/postgres.git
synced 2025-04-22 23:02:54 +03:00
Fix up error messages to remove extra newline. Use "zero" rather than "0.0".
This commit is contained in:
parent
ff4722cf77
commit
2d2562e90d
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/float.c,v 1.20 1997/09/08 21:48:25 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/float.c,v 1.21 1997/09/13 03:10:11 thomas Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -161,9 +161,9 @@ CheckFloat4Val(double val)
|
||||
return;
|
||||
#else
|
||||
if (fabs(val) > FLOAT4_MAX)
|
||||
elog(WARN, "\tBad float4 input format -- overflow\n");
|
||||
elog(WARN, "Bad float4 input format -- overflow");
|
||||
if (val != 0.0 && fabs(val) < FLOAT4_MIN)
|
||||
elog(WARN, "\tBad float4 input format -- underflow\n");
|
||||
elog(WARN, "Bad float4 input format -- underflow");
|
||||
return;
|
||||
#endif /* UNSAFE_FLOATS */
|
||||
}
|
||||
@ -186,9 +186,9 @@ CheckFloat8Val(double val)
|
||||
return;
|
||||
#else
|
||||
if (fabs(val) > FLOAT8_MAX)
|
||||
elog(WARN, "\tBad float8 input format -- overflow\n");
|
||||
elog(WARN, "Bad float8 input format -- overflow");
|
||||
if (val != 0.0 && fabs(val) < FLOAT8_MIN)
|
||||
elog(WARN, "\tBad float8 input format -- underflow\n");
|
||||
elog(WARN, "Bad float8 input format -- underflow");
|
||||
return;
|
||||
#endif /* UNSAFE_FLOATS */
|
||||
}
|
||||
@ -210,7 +210,7 @@ float4in(char *num)
|
||||
errno = 0;
|
||||
val = strtod(num, &endptr);
|
||||
if (*endptr != '\0' || errno == ERANGE)
|
||||
elog(WARN, "\tBad float4 input format\n");
|
||||
elog(WARN, "Bad float4 input format '%s'", num);
|
||||
|
||||
/*
|
||||
* if we get here, we have a legal double, still need to check to see
|
||||
@ -257,7 +257,7 @@ float8in(char *num)
|
||||
errno = 0;
|
||||
val = strtod(num, &endptr);
|
||||
if (*endptr != '\0' || errno == ERANGE)
|
||||
elog(WARN, "\tBad float8 input format\n");
|
||||
elog(WARN, "Bad float8 input format '%s'", num);
|
||||
|
||||
CheckFloat8Val(val);
|
||||
*result = val;
|
||||
@ -515,7 +515,7 @@ float4div(float32 arg1, float32 arg2)
|
||||
return (float32) NULL;
|
||||
|
||||
if (*arg2 == 0.0)
|
||||
elog(WARN, "float4div: divide by 0.0 error");
|
||||
elog(WARN, "float4div: divide by zero error");
|
||||
|
||||
val = *arg1 / *arg2;
|
||||
|
||||
@ -609,7 +609,7 @@ float8div(float64 arg1, float64 arg2)
|
||||
result = (float64) palloc(sizeof(float64data));
|
||||
|
||||
if (*arg2 == 0.0)
|
||||
elog(WARN, "float8div: divide by 0.0 error");
|
||||
elog(WARN, "float8div: divide by zero error");
|
||||
|
||||
val = *arg1 / *arg2;
|
||||
CheckFloat8Val(val);
|
||||
@ -805,11 +805,11 @@ dtoi4(float64 num)
|
||||
{
|
||||
int32 result;
|
||||
|
||||
if (!num)
|
||||
elog(WARN, "dtoi4: unable to convert null", NULL);
|
||||
if (!PointerIsValid(num))
|
||||
elog(WARN, "dtoi4: unable to convert null", NULL);
|
||||
|
||||
if ((*num < INT_MIN) || (*num > INT_MAX))
|
||||
elog(WARN, "dtoi4: integer out of range", NULL);
|
||||
elog(WARN, "dtoi4: integer out of range", NULL);
|
||||
|
||||
result = rint(*num);
|
||||
return (result);
|
||||
@ -824,11 +824,11 @@ dtoi2(float64 num)
|
||||
{
|
||||
int16 result;
|
||||
|
||||
if (!num)
|
||||
elog(WARN, "dtoi2: unable to convert null", NULL);
|
||||
if (!PointerIsValid(num))
|
||||
elog(WARN, "dtoi2: unable to convert null", NULL);
|
||||
|
||||
if ((*num < SHRT_MIN) || (*num > SHRT_MAX))
|
||||
elog(WARN, "dtoi2: integer out of range", NULL);
|
||||
elog(WARN, "dtoi2: integer out of range", NULL);
|
||||
|
||||
result = rint(*num);
|
||||
return (result);
|
||||
@ -873,11 +873,11 @@ ftoi4(float32 num)
|
||||
{
|
||||
int32 result;
|
||||
|
||||
if (!num)
|
||||
elog(WARN, "ftoi4: unable to convert null", NULL);
|
||||
if (!PointerIsValid(num))
|
||||
elog(WARN, "ftoi4: unable to convert null", NULL);
|
||||
|
||||
if ((*num < INT_MIN) || (*num > INT_MAX))
|
||||
elog(WARN, "ftoi4: integer out of range", NULL);
|
||||
elog(WARN, "ftoi4: integer out of range", NULL);
|
||||
|
||||
result = rint(*num);
|
||||
return (result);
|
||||
@ -892,11 +892,11 @@ ftoi2(float32 num)
|
||||
{
|
||||
int16 result;
|
||||
|
||||
if (!num)
|
||||
elog(WARN, "ftoi2: unable to convert null", NULL);
|
||||
if (!PointerIsValid(num))
|
||||
elog(WARN, "ftoi2: unable to convert null", NULL);
|
||||
|
||||
if ((*num < SHRT_MIN) || (*num > SHRT_MAX))
|
||||
elog(WARN, "ftoi2: integer out of range", NULL);
|
||||
elog(WARN, "ftoi2: integer out of range", NULL);
|
||||
|
||||
result = rint(*num);
|
||||
return (result);
|
||||
@ -1052,7 +1052,7 @@ dpow(float64 arg1, float64 arg2)
|
||||
#else
|
||||
if (!finite(*result))
|
||||
#endif
|
||||
elog(WARN, "pow() returned a floating point out of the range\n");
|
||||
elog(WARN, "pow() result is out of range");
|
||||
|
||||
CheckFloat8Val(*result);
|
||||
return (result);
|
||||
@ -1083,7 +1083,7 @@ dexp(float64 arg1)
|
||||
#else
|
||||
if (!finite(*result))
|
||||
#endif
|
||||
elog(WARN, "exp() returned a floating point out of range\n");
|
||||
elog(WARN, "exp() result is out of range");
|
||||
|
||||
CheckFloat8Val(*result);
|
||||
return (result);
|
||||
@ -1107,7 +1107,7 @@ dlog1(float64 arg1)
|
||||
|
||||
tmp = *arg1;
|
||||
if (tmp == 0.0)
|
||||
elog(WARN, "can't take log of 0!");
|
||||
elog(WARN, "can't take log of zero");
|
||||
if (tmp < 0)
|
||||
elog(WARN, "can't take log of a negative number");
|
||||
*result = (float64data) log(tmp);
|
||||
@ -1185,7 +1185,7 @@ float48div(float32 arg1, float64 arg2)
|
||||
result = (float64) palloc(sizeof(float64data));
|
||||
|
||||
if (*arg2 == 0.0)
|
||||
elog(WARN, "float48div: divide by 0.0 error!");
|
||||
elog(WARN, "float48div: divide by zero");
|
||||
|
||||
*result = *arg1 / *arg2;
|
||||
CheckFloat8Val(*result);
|
||||
@ -1255,7 +1255,7 @@ float84div(float64 arg1, float32 arg2)
|
||||
result = (float64) palloc(sizeof(float64data));
|
||||
|
||||
if (*arg2 == 0.0)
|
||||
elog(WARN, "float48div: divide by 0.0 error!");
|
||||
elog(WARN, "float48div: divide by zero");
|
||||
|
||||
*result = *arg1 / *arg2;
|
||||
CheckFloat8Val(*result);
|
||||
|
Loading…
x
Reference in New Issue
Block a user