tldm-universe/Ardent/UV/gcidir/include/fn_spec.h
2024-09-09 17:51:08 -04:00

113 lines
3.7 KiB
C
Executable File

/******************************************************************************
*
* fn_spec.h - Used by the ICI convertion routines.
*
* Module %M% Version %I% Date %H%
*
* (c) Copyright 1998 Ardent Software Inc. - All Rights Reserved
* This is unpublished proprietary source code of Ardent Software, Inc.
* The copyright notice above does not evidence any actual or intented
* publication of such source code.
*
*******************************************************************************
*
* Maintenence log - insert most recent change descriptions at top
*
* Date.... GTAR# WHO Description.........................................
* 10/14/98 23801 SAP Change copyrights.
* 04/06/94 12306 JC Removed unwanted sccs defines.
* 13.12.93 12306 JC Creation of Module. Based on the PI/open version.
*
*
*
*
*
*****************************************************************************/
/* START-HISTORY:
*
* 14 May 93 (GMCCLEAN) [PIGS 5220, SPAR none]
* Modified for product name change (interCALL).
* 17 Sep 92 (WILLIAMS) Module created.
*
* END-HISTORY
*
* START-DESCRIPTION:
*
* This file contains a number of constants and macros, extracted from
* the PI/open source, which are needed by the conversion and formatting
* code which has been adapted to run on a PC for use by interCALL.
* See text for details.
*
* END-DESCRIPTION
*
* START-DESIGN:
*
* END-DESIGN
*
* START-FUTURES:
*
* END-FUTURES
*
* START-CODE:
*/
/* ------------------------------------------------------------
* Constants extracted from :run.machine:include:machine_dep.h
* ------------------------------------------------------------
*
* Platform independent values
*/
#define MAX_PI_NUMBER 1.70141183460469231731687303715884105727E38
#define INT32_DIGITS 9
#define MAX_INT32_MSL 2
#define MAX_INT32_LSL 147483647
/*
* The following values are dependent on the floating point
* hardware in use and the length of integers. These are values
* appropriate to the PC.
*/
#define OVERFLOW_DIGITS 39
#define MAX_PRECISE_NUMBER 1.44115188075855871E17
#define MAX_PRECISION_DIGITS 17
/* ------------------------------------------------------------
* Constants extracted from :include:pi_limits.h
* ------------------------------------------------------------ */
#define MAX_PRECISION 14 /* Max value that PRECISION statement takes*/
/* ------------------------------------------------------------
* Constants and macros extracted from :include:pi_typedef.h
* ------------------------------------------------------------ */
#define INT32_MAX ((int)0x7fffffff)
#define INT32_MIN ((int)0x80000000)
/* ----------------------------------------------------------------------
* powers-of-ten tables extracted from :run.machine:include:rm_powers.h
* ---------------------------------------------------------------------- */
#define MAX_INT_POWER 9
#define MAX_DBL_POWER 31
extern int iten2the[MAX_INT_POWER + 1];
extern double tentothe[MAX_DBL_POWER + 1];
extern double minustento[MAX_DBL_POWER + 1];
/* ----------------------------------------------------------------------
* macro that uses these tables, extracted from :include:rm_macros.h
* ---------------------------------------------------------------------- */
/*
* N.B. This macro requires the include file math.h, to get the
* declaration of the pow() function.
*/
#define rm_pow10(power)\
( ((power) <= MAX_DBL_POWER && (power) >= -(MAX_DBL_POWER)) ? \
(power) >= 0 ? tentothe[(power)] : minustento[-(power)] : \
pow(1.0E1,(double)(power)) )
/* END-CODE */