greenplumn float_utils 源码
greenplumn float_utils 代码
文件路径:/src/include/utils/float_utils.h
/*-------------------------------------------------------------------------
*
* float_utils.h - Declarations for complex data type
*
*
* Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
* Portions Copyright (c) 2016-Present VMware, Inc. or its affiliates.
*
*
* IDENTIFICATION
* src/include/utils/float_utils.h
*
* NOTE
* These routines do *not* use the float types from adt/.
*
* XXX These routines were not written by a numerical analyst.
*
*-------------------------------------------------------------------------
*/
#ifndef FLOAT_UTILS_H
#define FLOAT_UTILS_H
/*
* check to see if a float4/8 val has underflowed or overflowed
* N.B: This code came from float.h because it is now used in both
* float and complex number types
*/
#define CHECKFLOATVAL(val, inf_is_valid, zero_is_valid) \
do { \
if (isinf(val) && !(inf_is_valid)) \
ereport(ERROR, \
(errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE), \
errmsg("value out of range: overflow"))); \
\
if ((val) == 0.0 && !(zero_is_valid)) \
ereport(ERROR, \
(errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE), \
errmsg("value out of range: underflow"))); \
} while(0)
#endif /* FLOAT_UTILS_H */
相关信息
相关文章
0
赞
热门推荐
-
2、 - 优质文章
-
3、 gate.io
-
7、 golang
-
9、 openharmony
-
10、 Vue中input框自动聚焦