Blame math/fenv.h

Packit Service 82fcde
/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
Packit Service 82fcde
   This file is part of the GNU C Library.
Packit Service 82fcde
Packit Service 82fcde
   The GNU C Library is free software; you can redistribute it and/or
Packit Service 82fcde
   modify it under the terms of the GNU Lesser General Public
Packit Service 82fcde
   License as published by the Free Software Foundation; either
Packit Service 82fcde
   version 2.1 of the License, or (at your option) any later version.
Packit Service 82fcde
Packit Service 82fcde
   The GNU C Library is distributed in the hope that it will be useful,
Packit Service 82fcde
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service 82fcde
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit Service 82fcde
   Lesser General Public License for more details.
Packit Service 82fcde
Packit Service 82fcde
   You should have received a copy of the GNU Lesser General Public
Packit Service 82fcde
   License along with the GNU C Library; if not, see
Packit Service 82fcde
   <http://www.gnu.org/licenses/>.  */
Packit Service 82fcde
Packit Service 82fcde
/*
Packit Service 82fcde
 * ISO C99 7.6: Floating-point environment	<fenv.h>
Packit Service 82fcde
 */
Packit Service 82fcde
Packit Service 82fcde
#ifndef _FENV_H
Packit Service 82fcde
#define _FENV_H	1
Packit Service 82fcde
Packit Service 82fcde
#define __GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION
Packit Service 82fcde
#include <bits/libc-header-start.h>
Packit Service 82fcde
Packit Service 82fcde
/* Get the architecture dependend definitions.  The following definitions
Packit Service 82fcde
   are expected to be done:
Packit Service 82fcde
Packit Service 82fcde
   fenv_t	type for object representing an entire floating-point
Packit Service 82fcde
		environment
Packit Service 82fcde
Packit Service 82fcde
   FE_DFL_ENV	macro of type pointer to fenv_t to be used as the argument
Packit Service 82fcde
		to functions taking an argument of type fenv_t; in this
Packit Service 82fcde
		case the default environment will be used
Packit Service 82fcde
Packit Service 82fcde
   fexcept_t	type for object representing the floating-point exception
Packit Service 82fcde
		flags including status associated with the flags
Packit Service 82fcde
Packit Service 82fcde
   femode_t	type for object representing floating-point control modes
Packit Service 82fcde
Packit Service 82fcde
   FE_DFL_MODE	macro of type pointer to const femode_t to be used as the
Packit Service 82fcde
		argument to fesetmode; in this case the default control
Packit Service 82fcde
		modes will be used
Packit Service 82fcde
Packit Service 82fcde
   The following macros are defined iff the implementation supports this
Packit Service 82fcde
   kind of exception.
Packit Service 82fcde
   FE_INEXACT		inexact result
Packit Service 82fcde
   FE_DIVBYZERO		division by zero
Packit Service 82fcde
   FE_UNDERFLOW		result not representable due to underflow
Packit Service 82fcde
   FE_OVERFLOW		result not representable due to overflow
Packit Service 82fcde
   FE_INVALID		invalid operation
Packit Service 82fcde
Packit Service 82fcde
   FE_ALL_EXCEPT	bitwise OR of all supported exceptions
Packit Service 82fcde
Packit Service 82fcde
   The next macros are defined iff the appropriate rounding mode is
Packit Service 82fcde
   supported by the implementation.
Packit Service 82fcde
   FE_TONEAREST		round to nearest
Packit Service 82fcde
   FE_UPWARD		round toward +Inf
Packit Service 82fcde
   FE_DOWNWARD		round toward -Inf
Packit Service 82fcde
   FE_TOWARDZERO	round toward 0
Packit Service 82fcde
*/
Packit Service 82fcde
#include <bits/fenv.h>
Packit Service 82fcde
Packit Service 82fcde
__BEGIN_DECLS
Packit Service 82fcde
Packit Service 82fcde
/* Floating-point exception handling.  */
Packit Service 82fcde
Packit Service 82fcde
/* Clear the supported exceptions represented by EXCEPTS.  */
Packit Service 82fcde
extern int feclearexcept (int __excepts) __THROW;
Packit Service 82fcde
Packit Service 82fcde
/* Store implementation-defined representation of the exception flags
Packit Service 82fcde
   indicated by EXCEPTS in the object pointed to by FLAGP.  */
Packit Service 82fcde
extern int fegetexceptflag (fexcept_t *__flagp, int __excepts) __THROW;
Packit Service 82fcde
Packit Service 82fcde
/* Raise the supported exceptions represented by EXCEPTS.  */
Packit Service 82fcde
extern int feraiseexcept (int __excepts) __THROW;
Packit Service 82fcde
Packit Service 82fcde
#if __GLIBC_USE (IEC_60559_BFP_EXT)
Packit Service 82fcde
/* Set the supported exception flags represented by EXCEPTS, without
Packit Service 82fcde
   causing enabled traps to be taken.  */
Packit Service 82fcde
extern int fesetexcept (int __excepts) __THROW;
Packit Service 82fcde
#endif
Packit Service 82fcde
Packit Service 82fcde
/* Set complete status for exceptions indicated by EXCEPTS according to
Packit Service 82fcde
   the representation in the object pointed to by FLAGP.  */
Packit Service 82fcde
extern int fesetexceptflag (const fexcept_t *__flagp, int __excepts) __THROW;
Packit Service 82fcde
Packit Service 82fcde
/* Determine which of subset of the exceptions specified by EXCEPTS are
Packit Service 82fcde
   currently set.  */
Packit Service 82fcde
extern int fetestexcept (int __excepts) __THROW;
Packit Service 82fcde
Packit Service 82fcde
#if __GLIBC_USE (IEC_60559_BFP_EXT)
Packit Service 82fcde
/* Determine which of subset of the exceptions specified by EXCEPTS
Packit Service 82fcde
   are set in *FLAGP.  */
Packit Service 82fcde
extern int fetestexceptflag (const fexcept_t *__flagp, int __excepts) __THROW;
Packit Service 82fcde
#endif
Packit Service 82fcde
Packit Service 82fcde
Packit Service 82fcde
/* Rounding control.  */
Packit Service 82fcde
Packit Service 82fcde
/* Get current rounding direction.  */
Packit Service 82fcde
extern int fegetround (void) __THROW __attribute_pure__;
Packit Service 82fcde
Packit Service 82fcde
/* Establish the rounding direction represented by ROUND.  */
Packit Service 82fcde
extern int fesetround (int __rounding_direction) __THROW;
Packit Service 82fcde
Packit Service 82fcde
Packit Service 82fcde
/* Floating-point environment.  */
Packit Service 82fcde
Packit Service 82fcde
/* Store the current floating-point environment in the object pointed
Packit Service 82fcde
   to by ENVP.  */
Packit Service 82fcde
extern int fegetenv (fenv_t *__envp) __THROW;
Packit Service 82fcde
Packit Service 82fcde
/* Save the current environment in the object pointed to by ENVP, clear
Packit Service 82fcde
   exception flags and install a non-stop mode (if available) for all
Packit Service 82fcde
   exceptions.  */
Packit Service 82fcde
extern int feholdexcept (fenv_t *__envp) __THROW;
Packit Service 82fcde
Packit Service 82fcde
/* Establish the floating-point environment represented by the object
Packit Service 82fcde
   pointed to by ENVP.  */
Packit Service 82fcde
extern int fesetenv (const fenv_t *__envp) __THROW;
Packit Service 82fcde
Packit Service 82fcde
/* Save current exceptions in temporary storage, install environment
Packit Service 82fcde
   represented by object pointed to by ENVP and raise exceptions
Packit Service 82fcde
   according to saved exceptions.  */
Packit Service 82fcde
extern int feupdateenv (const fenv_t *__envp) __THROW;
Packit Service 82fcde
Packit Service 82fcde
Packit Service 82fcde
/* Control modes.  */
Packit Service 82fcde
Packit Service 82fcde
#if __GLIBC_USE (IEC_60559_BFP_EXT)
Packit Service 82fcde
/* Store the current floating-point control modes in the object
Packit Service 82fcde
   pointed to by MODEP.  */
Packit Service 82fcde
extern int fegetmode (femode_t *__modep) __THROW;
Packit Service 82fcde
Packit Service 82fcde
/* Establish the floating-point control modes represented by the
Packit Service 82fcde
   object pointed to by MODEP.  */
Packit Service 82fcde
extern int fesetmode (const femode_t *__modep) __THROW;
Packit Service 82fcde
#endif
Packit Service 82fcde
Packit Service 82fcde
/* Include optimization.  */
Packit Service 82fcde
#ifdef __OPTIMIZE__
Packit Service 82fcde
# include <bits/fenvinline.h>
Packit Service 82fcde
#endif
Packit Service 82fcde
Packit Service 82fcde
/* NaN support.  */
Packit Service 82fcde
Packit Service 82fcde
#if (__GLIBC_USE (IEC_60559_BFP_EXT)		\
Packit Service 82fcde
     && defined FE_INVALID			\
Packit Service 82fcde
     && defined __SUPPORT_SNAN__)
Packit Service 82fcde
# define FE_SNANS_ALWAYS_SIGNAL	1
Packit Service 82fcde
#endif
Packit Service 82fcde
Packit Service 82fcde
#ifdef __USE_GNU
Packit Service 82fcde
Packit Service 82fcde
/* Enable individual exceptions.  Will not enable more exceptions than
Packit Service 82fcde
   EXCEPTS specifies.  Returns the previous enabled exceptions if all
Packit Service 82fcde
   exceptions are successfully set, otherwise returns -1.  */
Packit Service 82fcde
extern int feenableexcept (int __excepts) __THROW;
Packit Service 82fcde
Packit Service 82fcde
/* Disable individual exceptions.  Will not disable more exceptions than
Packit Service 82fcde
   EXCEPTS specifies.  Returns the previous enabled exceptions if all
Packit Service 82fcde
   exceptions are successfully disabled, otherwise returns -1.  */
Packit Service 82fcde
extern int fedisableexcept (int __excepts) __THROW;
Packit Service 82fcde
Packit Service 82fcde
/* Return enabled exceptions.  */
Packit Service 82fcde
extern int fegetexcept (void) __THROW;
Packit Service 82fcde
#endif
Packit Service 82fcde
Packit Service 82fcde
__END_DECLS
Packit Service 82fcde
Packit Service 82fcde
#endif /* fenv.h */