/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* Copyright (c) 1988 by Sun Microsystems, Inc.
*/
/*
* IEEE floating-point definitions for constants, types, variables, and
* functions implemented in libc.a for: IEEE floating-point arithmetic base
* conversion; IEEE floating-point arithmetic modes; IEEE floating-point
* arithmetic exception handling; certain functions defined in 4.3 BSD and
* System V.
*/
#ifndef _floatingpoint_h
#define _floatingpoint_h
/* Sun TYPES for IEEE floating point. */
typedef float single;
#ifdef __STDC__
#else
typedef struct {
unsigned long u[4];
#endif
typedef unsigned fp_exception_field_type;
/*
* A field containing fp_exceptions OR'ed together.
*/
typedef void (*sigfpe_handler_type) ();
/* Pointer to exception handler function. */
/* Sun VARIABLES for IEEE floating point. */
extern enum fp_direction_type fp_direction;
/*
* Current rounding direction. Updated by ieee_flags.
*/
extern enum fp_precision_type fp_precision;
/*
* Current rounding precision. Updated by ieee_flags.
*/
/*
* Sticky accumulated exceptions, updated by ieee_flags. In hardware
* implementations this variable is not automatically updated as the hardware
* changes and should therefore not be relied on directly.
*/
/* Sun definitions for base conversion. */
/* Size of buffer in decimal_record. */
/* Decimal significand. */
typedef struct {
int sign;
int exponent;
* digit, except the string-terminating ascii
* null. */
* indicates more non-zero digits following
* ds. */
* decimal, contains number of digits
* required for ds. */
}
enum decimal_form {
* of digits after point; if negative,
* specifies rounding to occur to left of
* point. */
* of significant digits. */
};
typedef struct {
/* Rounding direction. */
}
};
/* The following externs are used in the implementation of sprintf. */
extern void double_to_decimal();
extern void quadruple_to_decimal();
extern char *econvert();
extern char *fconvert();
extern char *gconvert();
extern char *qeconvert();
extern char *qfconvert();
extern char *qgconvert();
/*
The following are used for other parts of base conversion.
*/
/*
* Array of pointers to functions to handle SIGFPE's corresponding to IEEE
* fp_exceptions. sigfpe_default means do not generate SIGFPE. An invalid
* address such as sigfpe_abort will cause abort on that SIGFPE. Updated by
* ieee_handler.
*/
extern sigfpe_handler_type sigfpe();
extern void single_to_decimal();
extern void extended_to_decimal();
extern void decimal_to_single();
extern void decimal_to_double();
extern void decimal_to_extended();
extern void decimal_to_quadruple();
extern char *seconvert();
extern char *sfconvert();
extern char *sgconvert();
extern void string_to_decimal();
extern void file_to_decimal();
extern void func_to_decimal();
/* Definitions from 4.3 BSD math.h 4.6 9/11/85 */
extern double atof();
/* Definitions from System V */
extern int errno;
extern double strtod();
#endif /* !_floatingpoint_h */