Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
2d2562e9
Commit
2d2562e9
authored
Sep 13, 1997
by
Thomas G. Lockhart
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix up error messages to remove extra newline. Use "zero" rather than "0.0".
parent
ff4722cf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
26 deletions
+26
-26
src/backend/utils/adt/float.c
src/backend/utils/adt/float.c
+26
-26
No files found.
src/backend/utils/adt/float.c
View file @
2d2562e9
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/float.c,v 1.2
0 1997/09/08 21:48:25 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/float.c,v 1.2
1 1997/09/13 03:10:11 thomas
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -161,9 +161,9 @@ CheckFloat4Val(double val)
return
;
#else
if
(
fabs
(
val
)
>
FLOAT4_MAX
)
elog
(
WARN
,
"
\t
Bad float4 input format -- overflow
\n
"
);
elog
(
WARN
,
"
Bad float4 input format -- overflow
"
);
if
(
val
!=
0
.
0
&&
fabs
(
val
)
<
FLOAT4_MIN
)
elog
(
WARN
,
"
\t
Bad 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
,
"
\t
Bad float8 input format -- overflow
\n
"
);
elog
(
WARN
,
"
Bad float8 input format -- overflow
"
);
if
(
val
!=
0
.
0
&&
fabs
(
val
)
<
FLOAT8_MIN
)
elog
(
WARN
,
"
\t
Bad 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
,
"
\t
Bad 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
,
"
\t
Bad 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() re
turned a floating point out of the range
\n
"
);
elog
(
WARN
,
"pow() re
sult is out of range
"
);
CheckFloat8Val
(
*
result
);
return
(
result
);
...
...
@@ -1083,7 +1083,7 @@ dexp(float64 arg1)
#else
if
(
!
finite
(
*
result
))
#endif
elog
(
WARN
,
"exp() re
turned a floating point out of range
\n
"
);
elog
(
WARN
,
"exp() re
sult 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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment