float.h revision 128629
159243Sobrien/*
259243Sobrien * Copyright (c) 1989 Regents of the University of California.
359243Sobrien * All rights reserved.
459243Sobrien *
559243Sobrien * Redistribution and use in source and binary forms, with or without
659243Sobrien * modification, are permitted provided that the following conditions
759243Sobrien * are met:
859243Sobrien * 1. Redistributions of source code must retain the above copyright
959243Sobrien *    notice, this list of conditions and the following disclaimer.
1059243Sobrien * 2. Redistributions in binary form must reproduce the above copyright
1159243Sobrien *    notice, this list of conditions and the following disclaimer in the
1259243Sobrien *    documentation and/or other materials provided with the distribution.
1359243Sobrien * 4. Neither the name of the University nor the names of its contributors
1459243Sobrien *    may be used to endorse or promote products derived from this software
1559243Sobrien *    without specific prior written permission.
1659243Sobrien *
1759243Sobrien * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
1859243Sobrien * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1959243Sobrien * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2059243Sobrien * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
2159243Sobrien * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2259243Sobrien * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2359243Sobrien * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2459243Sobrien * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2559243Sobrien * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2659243Sobrien * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2759243Sobrien * SUCH DAMAGE.
2859243Sobrien *
2959243Sobrien *	from: @(#)float.h	7.1 (Berkeley) 5/8/90
3059243Sobrien * $FreeBSD: head/sys/amd64/include/float.h 128629 2004-04-25 02:36:29Z das $
3159243Sobrien */
3259243Sobrien
3359243Sobrien#ifndef _MACHINE_FLOAT_H_
3459243Sobrien#define _MACHINE_FLOAT_H_ 1
3559243Sobrien
3659243Sobrien#include <sys/cdefs.h>
3759243Sobrien
3859243Sobrien#define FLT_RADIX	2		/* b */
3959243Sobrien#define FLT_ROUNDS	1		/* FP addition rounds to nearest */
4059243Sobrien#if __ISO_C_VISIBLE >= 1999
4159243Sobrien#define	FLT_EVAL_METHOD	(-1)		/* i387 semantics are...interesting */
4259243Sobrien#define	DECIMAL_DIG	21		/* max precision in decimal digits */
4359243Sobrien#endif
4459243Sobrien
4559243Sobrien#define FLT_MANT_DIG	24		/* p */
4659243Sobrien#define FLT_EPSILON	1.19209290E-07F	/* b**(1-p) */
4759243Sobrien#define FLT_DIG		6		/* floor((p-1)*log10(b))+(b == 10) */
4859243Sobrien#define FLT_MIN_EXP	(-125)		/* emin */
4959243Sobrien#define FLT_MIN		1.17549435E-38F	/* b**(emin-1) */
5059243Sobrien#define FLT_MIN_10_EXP	(-37)		/* ceil(log10(b**(emin-1))) */
5159243Sobrien#define FLT_MAX_EXP	128		/* emax */
5259243Sobrien#define FLT_MAX		3.40282347E+38F	/* (1-b**(-p))*b**emax */
5359243Sobrien#define FLT_MAX_10_EXP	38		/* floor(log10((1-b**(-p))*b**emax)) */
5459243Sobrien
5559243Sobrien#define DBL_MANT_DIG	53
5659243Sobrien#define DBL_EPSILON	2.2204460492503131E-16
5759243Sobrien#define DBL_DIG		15
5859243Sobrien#define DBL_MIN_EXP	(-1021)
5959243Sobrien#define DBL_MIN		2.2250738585072014E-308
6059243Sobrien#define DBL_MIN_10_EXP	(-307)
6159243Sobrien#define DBL_MAX_EXP	1024
6259243Sobrien#define DBL_MAX		1.7976931348623157E+308
6359243Sobrien#define DBL_MAX_10_EXP	308
6459243Sobrien
6559243Sobrien
6659243Sobrien#define LDBL_MANT_DIG	64
6759243Sobrien#define LDBL_EPSILON	1.0842021724855044340E-19L
6859243Sobrien#define LDBL_DIG	18
6959243Sobrien#define LDBL_MIN_EXP	(-16381)
7059243Sobrien#define LDBL_MIN	3.3621031431120935063E-4932L
7159243Sobrien#define LDBL_MIN_10_EXP	(-4931)
7259243Sobrien#define LDBL_MAX_EXP	16384
7359243Sobrien#define LDBL_MAX	1.1897314953572317650E+4932L
7459243Sobrien#define LDBL_MAX_10_EXP	4932
7559243Sobrien#endif /* _MACHINE_FLOAT_H_ */
7659243Sobrien