Home | History | Annotate | Line # | Download | only in include
float.h revision 1.19.2.1
      1  1.19.2.1  perseant /*	$NetBSD: float.h,v 1.19.2.1 2025/08/02 05:55:53 perseant Exp $ */
      2      1.14      matt 
      3      1.17  christos /*-
      4      1.17  christos  * Copyright (c) 2013 The NetBSD Foundation, Inc.
      5      1.17  christos  * All rights reserved.
      6      1.17  christos  *
      7      1.17  christos  * Redistribution and use in source and binary forms, with or without
      8      1.17  christos  * modification, are permitted provided that the following conditions
      9      1.17  christos  * are met:
     10      1.17  christos  * 1. Redistributions of source code must retain the above copyright
     11      1.17  christos  *    notice, this list of conditions and the following disclaimer.
     12      1.17  christos  * 2. Redistributions in binary form must reproduce the above copyright
     13      1.17  christos  *    notice, this list of conditions and the following disclaimer in the
     14      1.17  christos  *    documentation and/or other materials provided with the distribution.
     15      1.17  christos  *
     16      1.17  christos  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     17      1.17  christos  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     18      1.17  christos  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     19      1.17  christos  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     20      1.17  christos  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     21      1.17  christos  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     22      1.17  christos  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     23      1.17  christos  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     24      1.17  christos  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     25      1.17  christos  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     26      1.17  christos  * POSSIBILITY OF SUCH DAMAGE.
     27      1.17  christos  */
     28      1.14      matt #ifndef _MIPS_FLOAT_H_
     29      1.18    simonb #define	_MIPS_FLOAT_H_
     30      1.14      matt 
     31      1.16      matt #include <sys/cdefs.h>
     32  1.19.2.1  perseant #include <sys/featuretest.h>
     33      1.16      matt 
     34      1.14      matt #if defined(__mips_n32) || defined(__mips_n64)
     35      1.14      matt 
     36      1.15      matt #if __GNUC_PREREQ__(4,1)
     37      1.15      matt 
     38      1.18    simonb #define	LDBL_MANT_DIG	__LDBL_MANT_DIG__
     39      1.15      matt #define	LDBL_DIG	__LDBL_DIG__
     40      1.15      matt #define	LDBL_MIN_EXP	__LDBL_MIN_EXP__
     41      1.15      matt #define	LDBL_MIN_10_EXP	__LDBL_MIN_10_EXP__
     42      1.15      matt #define	LDBL_MAX_EXP	__LDBL_MAX_EXP__
     43      1.15      matt #define	LDBL_MAX_10_EXP	__LDBL_MAX_10_EXP__
     44      1.15      matt #define	LDBL_EPSILON	__LDBL_EPSILON__
     45      1.15      matt #define	LDBL_MIN	__LDBL_MIN__
     46      1.15      matt #define	LDBL_MAX	__LDBL_MAX__
     47      1.15      matt 
     48      1.15      matt #else
     49      1.15      matt 
     50      1.18    simonb #define	LDBL_MANT_DIG	113
     51      1.14      matt #define	LDBL_DIG	33
     52      1.14      matt #define	LDBL_MIN_EXP	(-16381)
     53      1.14      matt #define	LDBL_MIN_10_EXP	(-4931)
     54      1.14      matt #define	LDBL_MAX_EXP	16384
     55      1.14      matt #define	LDBL_MAX_10_EXP	4932
     56      1.15      matt #if __STDC_VERSION__ >= 199901L
     57      1.15      matt #define	LDBL_EPSILON	0x1p-112L
     58      1.15      matt #define	LDBL_MIN	0x1p-16382L
     59      1.19    rillig #define	LDBL_MAX	0x1.ffffffffffffffffffffffffffffp+16383L
     60      1.15      matt #else
     61      1.15      matt #define	LDBL_EPSILON	1.9259299443872358530559779425849273E-34L
     62      1.15      matt #define	LDBL_MIN	3.3621031431120935062626778173217526E-4932L
     63      1.15      matt #define	LDBL_MAX	1.1897314953572317650857593266280070E+4932L
     64      1.15      matt #endif
     65      1.15      matt 
     66      1.15      matt #endif /* !__GNUC_PREREQ__(4,1) */
     67      1.14      matt 
     68      1.14      matt #endif	/* __mips_n32 || __mips_n64 */
     69       1.4       cgd 
     70      1.13    kleink #include <sys/float_ieee754.h>
     71      1.14      matt 
     72      1.14      matt #if defined(__mips_n32) || defined(__mips_n64)
     73      1.14      matt 
     74      1.14      matt #if !defined(_ANSI_SOURCE) && !defined(_POSIX_C_SOURCE) && \
     75      1.14      matt     !defined(_XOPEN_SOURCE) || \
     76      1.14      matt     ((__STDC_VERSION__ - 0) >= 199901L) || \
     77      1.14      matt     ((_POSIX_C_SOURCE - 0) >= 200112L) || \
     78      1.14      matt     ((_XOPEN_SOURCE  - 0) >= 600) || \
     79      1.14      matt     defined(_ISOC99_SOURCE) || defined(_NETBSD_SOURCE)
     80      1.15      matt #if __GNUC_PREREQ__(4,1)
     81      1.15      matt #define	DECIMAL_DIG	__DECIMAL_DIG__
     82      1.15      matt #else
     83      1.14      matt #define	DECIMAL_DIG	36
     84      1.15      matt #endif
     85      1.14      matt #endif /* !defined(_ANSI_SOURCE) && ... */
     86      1.14      matt 
     87      1.14      matt #endif	/* __mips_n32 || __mips_n64 */
     88      1.14      matt 
     89      1.14      matt #endif	/* _MIPS_FLOAT_H_ */
     90