greenplumn float_utils 源码

  • 2022-08-18
  • 浏览 (327)

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 */

相关信息

greenplumn 源码目录

相关文章

greenplumn acl 源码

greenplumn aclchk_internal 源码

greenplumn array 源码

greenplumn arrayaccess 源码

greenplumn ascii 源码

greenplumn attoptcache 源码

greenplumn backend_cancel 源码

greenplumn bitmap_compression 源码

greenplumn bitstream 源码

greenplumn builtins 源码

0  赞