float.h revision 230191
1139735Simp/*-
2129198Scognet * Copyright (c) 1989 Regents of the University of California.
3129198Scognet * All rights reserved.
4129198Scognet *
5129198Scognet * Redistribution and use in source and binary forms, with or without
6129198Scognet * modification, are permitted provided that the following conditions
7129198Scognet * are met:
8129198Scognet * 1. Redistributions of source code must retain the above copyright
9129198Scognet *    notice, this list of conditions and the following disclaimer.
10129198Scognet * 2. Redistributions in binary form must reproduce the above copyright
11129198Scognet *    notice, this list of conditions and the following disclaimer in the
12129198Scognet *    documentation and/or other materials provided with the distribution.
13129198Scognet * 3. All advertising materials mentioning features or use of this software
14129198Scognet *    must display the following acknowledgement:
15129198Scognet *	This product includes software developed by the University of
16129198Scognet *	California, Berkeley and its contributors.
17129198Scognet * 4. Neither the name of the University nor the names of its contributors
18129198Scognet *    may be used to endorse or promote products derived from this software
19129198Scognet *    without specific prior written permission.
20129198Scognet *
21129198Scognet * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22129198Scognet * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23129198Scognet * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24129198Scognet * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25129198Scognet * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26129198Scognet * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27129198Scognet * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28129198Scognet * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29129198Scognet * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30129198Scognet * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31129198Scognet * SUCH DAMAGE.
32129198Scognet *
33129198Scognet *	from: @(#)float.h	7.1 (Berkeley) 5/8/90
34129198Scognet * $FreeBSD: head/sys/arm/include/float.h 230191 2012-01-16 04:08:29Z das $
35129198Scognet */
36129198Scognet
37129198Scognet#ifndef _MACHINE_FLOAT_H_
38129198Scognet#define _MACHINE_FLOAT_H_ 1
39129198Scognet
40143857Scognet#include <sys/cdefs.h>
41143857Scognet
42143857Scognet__BEGIN_DECLS
43143857Scognetextern int __flt_rounds(void);
44143857Scognet__END_DECLS
45143857Scognet
46129198Scognet#define FLT_RADIX	2		/* b */
47230191Sdas#ifndef	_ARM_HARD_FLOAT
48230191Sdas#define	FLT_ROUNDS	__flt_rounds()
49230191Sdas#else
50230191Sdas#define	FLT_ROUNDS	(-1)
51230191Sdas#endif
52132383Sdas#define	FLT_EVAL_METHOD	(-1)		/* XXX */
53143857Scognet#define	DECIMAL_DIG	17		/* max precision in decimal digits */
54129198Scognet
55129198Scognet#define FLT_MANT_DIG	24		/* p */
56129198Scognet#define FLT_EPSILON	1.19209290E-07F	/* b**(1-p) */
57129198Scognet#define FLT_DIG		6		/* floor((p-1)*log10(b))+(b == 10) */
58129198Scognet#define FLT_MIN_EXP	(-125)		/* emin */
59129198Scognet#define FLT_MIN		1.17549435E-38F	/* b**(emin-1) */
60129198Scognet#define FLT_MIN_10_EXP	(-37)		/* ceil(log10(b**(emin-1))) */
61129198Scognet#define FLT_MAX_EXP	128		/* emax */
62129198Scognet#define FLT_MAX		3.40282347E+38F	/* (1-b**(-p))*b**emax */
63129198Scognet#define FLT_MAX_10_EXP	38		/* floor(log10((1-b**(-p))*b**emax)) */
64129198Scognet
65129198Scognet#define DBL_MANT_DIG	53
66129198Scognet#define DBL_EPSILON	2.2204460492503131E-16
67129198Scognet#define DBL_DIG		15
68129198Scognet#define DBL_MIN_EXP	(-1021)
69129198Scognet#define DBL_MIN		2.2250738585072014E-308
70129198Scognet#define DBL_MIN_10_EXP	(-307)
71129198Scognet#define DBL_MAX_EXP	1024
72129198Scognet#define DBL_MAX		1.7976931348623157E+308
73129198Scognet#define DBL_MAX_10_EXP	308
74129198Scognet
75143857Scognet#define LDBL_MANT_DIG	DBL_MANT_DIG
76143857Scognet#define LDBL_EPSILON	DBL_EPSILON
77143857Scognet#define LDBL_DIG	DBL_DIG
78143857Scognet#define LDBL_MIN_EXP	DBL_MIN_EXP
79143857Scognet#define LDBL_MIN	DBL_MIN
80143857Scognet#define LDBL_MIN_10_EXP	DBL_MIN_10_EXP
81143857Scognet#define LDBL_MAX_EXP	DBL_MAX_EXP
82143857Scognet#define LDBL_MAX	DBL_MAX
83143857Scognet#define LDBL_MAX_10_EXP	DBL_MAX_10_EXP
84129198Scognet#endif /* _MACHINE_FLOAT_H_ */
85