xref: /freebsd/sys/amd64/include/float.h (revision 5b81b6b301437eb9a6df491c829475bd29ae5d6c)
15b81b6b3SRodney W. Grimes /*
25b81b6b3SRodney W. Grimes  * Copyright (c) 1989 Regents of the University of California.
35b81b6b3SRodney W. Grimes  * All rights reserved.
45b81b6b3SRodney W. Grimes  *
55b81b6b3SRodney W. Grimes  * Redistribution and use in source and binary forms, with or without
65b81b6b3SRodney W. Grimes  * modification, are permitted provided that the following conditions
75b81b6b3SRodney W. Grimes  * are met:
85b81b6b3SRodney W. Grimes  * 1. Redistributions of source code must retain the above copyright
95b81b6b3SRodney W. Grimes  *    notice, this list of conditions and the following disclaimer.
105b81b6b3SRodney W. Grimes  * 2. Redistributions in binary form must reproduce the above copyright
115b81b6b3SRodney W. Grimes  *    notice, this list of conditions and the following disclaimer in the
125b81b6b3SRodney W. Grimes  *    documentation and/or other materials provided with the distribution.
135b81b6b3SRodney W. Grimes  * 3. All advertising materials mentioning features or use of this software
145b81b6b3SRodney W. Grimes  *    must display the following acknowledgement:
155b81b6b3SRodney W. Grimes  *	This product includes software developed by the University of
165b81b6b3SRodney W. Grimes  *	California, Berkeley and its contributors.
175b81b6b3SRodney W. Grimes  * 4. Neither the name of the University nor the names of its contributors
185b81b6b3SRodney W. Grimes  *    may be used to endorse or promote products derived from this software
195b81b6b3SRodney W. Grimes  *    without specific prior written permission.
205b81b6b3SRodney W. Grimes  *
215b81b6b3SRodney W. Grimes  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
225b81b6b3SRodney W. Grimes  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
235b81b6b3SRodney W. Grimes  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
245b81b6b3SRodney W. Grimes  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
255b81b6b3SRodney W. Grimes  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
265b81b6b3SRodney W. Grimes  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
275b81b6b3SRodney W. Grimes  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
285b81b6b3SRodney W. Grimes  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
295b81b6b3SRodney W. Grimes  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
305b81b6b3SRodney W. Grimes  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
315b81b6b3SRodney W. Grimes  * SUCH DAMAGE.
325b81b6b3SRodney W. Grimes  *
335b81b6b3SRodney W. Grimes  *	@(#)float.h	7.1 (Berkeley) 5/8/90
345b81b6b3SRodney W. Grimes  *
355b81b6b3SRodney W. Grimes  * PATCHES MAGIC                LEVEL   PATCH THAT GOT US HERE
365b81b6b3SRodney W. Grimes  * --------------------         -----   ----------------------
375b81b6b3SRodney W. Grimes  * CURRENT PATCH LEVEL:         1       00086
385b81b6b3SRodney W. Grimes  * --------------------         -----   ----------------------
395b81b6b3SRodney W. Grimes  *
405b81b6b3SRodney W. Grimes  * 27 Feb 93    Handel/da Silva/Poirot  Adjust value for MAX_DOUBLE
415b81b6b3SRodney W. Grimes  */
425b81b6b3SRodney W. Grimes 
435b81b6b3SRodney W. Grimes #define FLT_RADIX	2		/* b */
445b81b6b3SRodney W. Grimes #define FLT_ROUNDS	1		/* FP addition rounds to nearest */
455b81b6b3SRodney W. Grimes 
465b81b6b3SRodney W. Grimes #define FLT_MANT_DIG	24		/* p */
475b81b6b3SRodney W. Grimes #define FLT_EPSILON	1.19209290E-07F	/* b**(1-p) */
485b81b6b3SRodney W. Grimes #define FLT_DIG		6		/* floor((p-1)*log10(b))+(b == 10) */
495b81b6b3SRodney W. Grimes #define FLT_MIN_EXP	-125		/* emin */
505b81b6b3SRodney W. Grimes #define FLT_MIN		1.17549435E-38F	/* b**(emin-1) */
515b81b6b3SRodney W. Grimes #define FLT_MIN_10_EXP	-37		/* ceil(log10(b**(emin-1))) */
525b81b6b3SRodney W. Grimes #define FLT_MAX_EXP	128		/* emax */
535b81b6b3SRodney W. Grimes #define FLT_MAX		3.40282347E+38F	/* (1-b**(-p))*b**emax */
545b81b6b3SRodney W. Grimes #define FLT_MAX_10_EXP	38		/* floor(log10((1-b**(-p))*b**emax)) */
555b81b6b3SRodney W. Grimes 
565b81b6b3SRodney W. Grimes #define DBL_MANT_DIG	53
575b81b6b3SRodney W. Grimes #define DBL_EPSILON	2.2204460492503131E-16
585b81b6b3SRodney W. Grimes #define DBL_DIG		15
595b81b6b3SRodney W. Grimes #define DBL_MIN_EXP	-1021
605b81b6b3SRodney W. Grimes #define DBL_MIN		2.225073858507201E-308
615b81b6b3SRodney W. Grimes #define DBL_MIN_10_EXP	-307
625b81b6b3SRodney W. Grimes #define DBL_MAX_EXP	1024
635b81b6b3SRodney W. Grimes #define DBL_MAX		1.797693134862315E+308
645b81b6b3SRodney W. Grimes #define DBL_MAX_10_EXP	308
655b81b6b3SRodney W. Grimes 
665b81b6b3SRodney W. Grimes #define LDBL_MANT_DIG	DBL_MANT_DIG
675b81b6b3SRodney W. Grimes #define LDBL_EPSILON	DBL_EPSILON
685b81b6b3SRodney W. Grimes #define LDBL_DIG	DBL_DIG
695b81b6b3SRodney W. Grimes #define LDBL_MIN_EXP	DBL_MIN_EXP
705b81b6b3SRodney W. Grimes #define LDBL_MIN	DBL_MIN
715b81b6b3SRodney W. Grimes #define LDBL_MIN_10_EXP	DBL_MIN_10_EXP
725b81b6b3SRodney W. Grimes #define LDBL_MAX_EXP	DBL_MAX_EXP
735b81b6b3SRodney W. Grimes #define LDBL_MAX	DBL_MAX
745b81b6b3SRodney W. Grimes #define LDBL_MAX_10_EXP	DBL_MAX_10_EXP
75