float.h revision 176826
1112158Sdas/*-
2112158Sdas * Copyright (c) 1989 Regents of the University of California.
3112158Sdas * All rights reserved.
4112158Sdas *
5112158Sdas * Redistribution and use in source and binary forms, with or without
6112158Sdas * modification, are permitted provided that the following conditions
7112158Sdas * are met:
8112158Sdas * 1. Redistributions of source code must retain the above copyright
9112158Sdas *    notice, this list of conditions and the following disclaimer.
10112158Sdas * 2. Redistributions in binary form must reproduce the above copyright
11112158Sdas *    notice, this list of conditions and the following disclaimer in the
12112158Sdas *    documentation and/or other materials provided with the distribution.
13112158Sdas * 4. Neither the name of the University nor the names of its contributors
14112158Sdas *    may be used to endorse or promote products derived from this software
15112158Sdas *    without specific prior written permission.
16112158Sdas *
17112158Sdas * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
18112158Sdas * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19112158Sdas * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20112158Sdas * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
21112158Sdas * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22112158Sdas * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23112158Sdas * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24112158Sdas * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25112158Sdas * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26112158Sdas * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27112158Sdas * SUCH DAMAGE.
28112158Sdas *
29165743Sdas *	from: @(#)float.h	7.1 (Berkeley) 5/8/90
30165743Sdas * $FreeBSD: head/sys/i386/include/float.h 176826 2008-03-05 11:17:20Z bde $
31112158Sdas */
32112158Sdas
33112158Sdas#ifndef _MACHINE_FLOAT_H_
34112158Sdas#define _MACHINE_FLOAT_H_ 1
35112158Sdas
36112158Sdas#include <sys/cdefs.h>
37112158Sdas
38112158Sdas__BEGIN_DECLS
39112158Sdasextern int __flt_rounds(void);
40112158Sdas__END_DECLS
41112158Sdas
42112158Sdas#define FLT_RADIX	2		/* b */
43112158Sdas#define FLT_ROUNDS	__flt_rounds()
44112158Sdas#if __ISO_C_VISIBLE >= 1999
45112158Sdas#define	FLT_EVAL_METHOD	(-1)		/* i387 semantics are...interesting */
46112158Sdas#define	DECIMAL_DIG	21		/* max precision in decimal digits */
47112158Sdas#endif
48112158Sdas
49112158Sdas#define FLT_MANT_DIG	24		/* p */
50112158Sdas#define FLT_EPSILON	1.19209290E-07F	/* b**(1-p) */
51112158Sdas#define FLT_DIG		6		/* floor((p-1)*log10(b))+(b == 10) */
52112158Sdas#define FLT_MIN_EXP	(-125)		/* emin */
53112158Sdas#define FLT_MIN		1.17549435E-38F	/* b**(emin-1) */
54112158Sdas#define FLT_MIN_10_EXP	(-37)		/* ceil(log10(b**(emin-1))) */
55112158Sdas#define FLT_MAX_EXP	128		/* emax */
56112158Sdas#define FLT_MAX		3.40282347E+38F	/* (1-b**(-p))*b**emax */
57112158Sdas#define FLT_MAX_10_EXP	38		/* floor(log10((1-b**(-p))*b**emax)) */
58112158Sdas
59112158Sdas#define DBL_MANT_DIG	53
60112158Sdas#define DBL_EPSILON	2.2204460492503131E-16
61112158Sdas#define DBL_DIG		15
62112158Sdas#define DBL_MIN_EXP	(-1021)
63112158Sdas#define DBL_MIN		2.2250738585072014E-308
64165743Sdas#define DBL_MIN_10_EXP	(-307)
65165743Sdas#define DBL_MAX_EXP	1024
66112158Sdas#define DBL_MAX		1.7976931348623157E+308
67112158Sdas#define DBL_MAX_10_EXP	308
68112158Sdas
69112158Sdas#define LDBL_MANT_DIG	64
70112158Sdas#define LDBL_EPSILON	1.0842021724855044340E-19L
71112158Sdas#define LDBL_DIG	18
72112158Sdas#define LDBL_MIN_EXP	(-16381)
73227753Stheraven#define LDBL_MIN	3.3621031431120935063E-4932L
74227753Stheraven#define LDBL_MIN_10_EXP	(-4931)
75112158Sdas#define LDBL_MAX_EXP	16384
76227753Stheraven#define LDBL_MAX	1.1897314953572317650E+4932L
77112158Sdas#define LDBL_MAX_10_EXP	4932
78112158Sdas#endif /* _MACHINE_FLOAT_H_ */
79112158Sdas