#ifndef _FLOATINGPOINT_H
#define _FLOATINGPOINT_H
#ifdef __STDC__
#include <stdio_tag.h>
#endif
#include <sys/ieeefp.h>
#ifdef __cplusplus
extern "C" {
#endif
#if defined(__STDC__) && !defined(_FILEDEFED)
#define _FILEDEFED
typedef __FILE FILE;
#endif
typedef int sigfpe_code_type;
typedef void (*sigfpe_handler_type)();
#define SIGFPE_DEFAULT (void (*)())0
#define SIGFPE_IGNORE (void (*)())1
#define SIGFPE_ABORT (void (*)())2
extern sigfpe_handler_type sigfpe(sigfpe_code_type, sigfpe_handler_type);
typedef float single;
#ifndef _EXTENDED
#define _EXTENDED
typedef unsigned extended[3];
#endif
typedef long double quadruple;
typedef unsigned fp_exception_field_type;
#define DECIMAL_STRING_LENGTH 512
typedef char decimal_string[DECIMAL_STRING_LENGTH];
typedef struct {
enum fp_class_type fpclass;
int sign;
int exponent;
decimal_string ds;
int more;
int ndigits;
} decimal_record;
enum decimal_form {
fixed_form,
floating_form
};
typedef struct {
enum fp_direction_type rd;
enum decimal_form df;
int ndigits;
} decimal_mode;
enum decimal_string_form {
invalid_form,
whitespace_form,
fixed_int_form,
fixed_intdot_form,
fixed_dotfrac_form,
fixed_intdotfrac_form,
floating_int_form,
floating_intdot_form,
floating_dotfrac_form,
floating_intdotfrac_form,
inf_form,
infinity_form,
nan_form,
nanstring_form
};
extern void single_to_decimal(single *, decimal_mode *, decimal_record *,
fp_exception_field_type *);
extern void double_to_decimal(double *, decimal_mode *, decimal_record *,
fp_exception_field_type *);
extern void extended_to_decimal(extended *, decimal_mode *,
decimal_record *, fp_exception_field_type *);
extern void quadruple_to_decimal(quadruple *, decimal_mode *,
decimal_record *, fp_exception_field_type *);
extern void decimal_to_single(single *, decimal_mode *, decimal_record *,
fp_exception_field_type *);
extern void decimal_to_double(double *, decimal_mode *, decimal_record *,
fp_exception_field_type *);
extern void decimal_to_extended(extended *, decimal_mode *,
decimal_record *, fp_exception_field_type *);
extern void decimal_to_quadruple(quadruple *, decimal_mode *,
decimal_record *, fp_exception_field_type *);
extern void string_to_decimal(char **, int, int, decimal_record *,
enum decimal_string_form *, char **);
extern void func_to_decimal(char **, int, int, decimal_record *,
enum decimal_string_form *, char **,
int (*)(void), int *, int (*)(int));
extern void file_to_decimal(char **, int, int, decimal_record *,
enum decimal_string_form *, char **,
FILE *, int *);
extern char *seconvert(single *, int, int *, int *, char *);
extern char *sfconvert(single *, int, int *, int *, char *);
extern char *sgconvert(single *, int, int, char *);
extern char *econvert(double, int, int *, int *, char *);
extern char *fconvert(double, int, int *, int *, char *);
extern char *gconvert(double, int, int, char *);
extern char *qeconvert(quadruple *, int, int *, int *, char *);
extern char *qfconvert(quadruple *, int, int *, int *, char *);
extern char *qgconvert(quadruple *, int, int, char *);
extern char *ecvt(double, int, int *, int *);
extern char *fcvt(double, int, int *, int *);
extern char *gcvt(double, int, char *);
#if __cplusplus >= 199711L
namespace std {
#endif
extern double atof(const char *);
extern double strtod(const char *, char **);
#if __cplusplus >= 199711L
}
using std::atof;
using std::strtod;
#endif
#ifdef __cplusplus
}
#endif
#endif