Blame math/complex.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.3 Complex arithmetic	<complex.h>
Packit Service 82fcde
 */
Packit Service 82fcde
Packit Service 82fcde
#ifndef _COMPLEX_H
Packit Service 82fcde
#define _COMPLEX_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 general and ISO C99 specific information.  */
Packit Service 82fcde
#include <bits/mathdef.h>
Packit Service 82fcde
Packit Service 82fcde
/* Gather machine-dependent _FloatN type support.  */
Packit Service 82fcde
#include <bits/floatn.h>
Packit Service 82fcde
Packit Service 82fcde
__BEGIN_DECLS
Packit Service 82fcde
Packit Service 82fcde
/* We might need to add support for more compilers here.  But since ISO
Packit Service 82fcde
   C99 is out hopefully all maintained compilers will soon provide the data
Packit Service 82fcde
   types `float complex' and `double complex'.  */
Packit Service 82fcde
#if __GNUC_PREREQ (2, 7) && !__GNUC_PREREQ (2, 97)
Packit Service 82fcde
# define _Complex __complex__
Packit Service 82fcde
#endif
Packit Service 82fcde
Packit Service 82fcde
#define complex		_Complex
Packit Service 82fcde
Packit Service 82fcde
/* Narrowest imaginary unit.  This depends on the floating-point
Packit Service 82fcde
   evaluation method.
Packit Service 82fcde
   XXX This probably has to go into a gcc related file.  */
Packit Service 82fcde
#define _Complex_I	(__extension__ 1.0iF)
Packit Service 82fcde
Packit Service 82fcde
/* Another more descriptive name is `I'.
Packit Service 82fcde
   XXX Once we have the imaginary support switch this to _Imaginary_I.  */
Packit Service 82fcde
#undef I
Packit Service 82fcde
#define I _Complex_I
Packit Service 82fcde
Packit Service 82fcde
#if defined __USE_ISOC11 && __GNUC_PREREQ (4, 7)
Packit Service 82fcde
/* Macros to expand into expression of specified complex type.  */
Packit Service 82fcde
# define CMPLX(x, y) __builtin_complex ((double) (x), (double) (y))
Packit Service 82fcde
# define CMPLXF(x, y) __builtin_complex ((float) (x), (float) (y))
Packit Service 82fcde
# define CMPLXL(x, y) __builtin_complex ((long double) (x), (long double) (y))
Packit Service 82fcde
#endif
Packit Service 82fcde
Packit Service 82fcde
#if __HAVE_FLOAT16 && __GLIBC_USE (IEC_60559_TYPES_EXT)
Packit Service 82fcde
# define CMPLXF16(x, y) __builtin_complex ((_Float16) (x), (_Float16) (y))
Packit Service 82fcde
#endif
Packit Service 82fcde
Packit Service 82fcde
#if __HAVE_FLOAT32 && __GLIBC_USE (IEC_60559_TYPES_EXT)
Packit Service 82fcde
# define CMPLXF32(x, y) __builtin_complex ((_Float32) (x), (_Float32) (y))
Packit Service 82fcde
#endif
Packit Service 82fcde
Packit Service 82fcde
#if __HAVE_FLOAT64 && __GLIBC_USE (IEC_60559_TYPES_EXT)
Packit Service 82fcde
# define CMPLXF64(x, y) __builtin_complex ((_Float64) (x), (_Float64) (y))
Packit Service 82fcde
#endif
Packit Service 82fcde
Packit Service 82fcde
#if __HAVE_FLOAT128 && __GLIBC_USE (IEC_60559_TYPES_EXT)
Packit Service 82fcde
# define CMPLXF128(x, y) __builtin_complex ((_Float128) (x), (_Float128) (y))
Packit Service 82fcde
#endif
Packit Service 82fcde
Packit Service 82fcde
#if __HAVE_FLOAT32X && __GLIBC_USE (IEC_60559_TYPES_EXT)
Packit Service 82fcde
# define CMPLXF32X(x, y) __builtin_complex ((_Float32x) (x), (_Float32x) (y))
Packit Service 82fcde
#endif
Packit Service 82fcde
Packit Service 82fcde
#if __HAVE_FLOAT64X && __GLIBC_USE (IEC_60559_TYPES_EXT)
Packit Service 82fcde
# define CMPLXF64X(x, y) __builtin_complex ((_Float64x) (x), (_Float64x) (y))
Packit Service 82fcde
#endif
Packit Service 82fcde
Packit Service 82fcde
#if __HAVE_FLOAT128X && __GLIBC_USE (IEC_60559_TYPES_EXT)
Packit Service 82fcde
# define CMPLXF128X(x, y)					\
Packit Service 82fcde
  __builtin_complex ((_Float128x) (x), (_Float128x) (y))
Packit Service 82fcde
#endif
Packit Service 82fcde
Packit Service 82fcde
/* The file <bits/cmathcalls.h> contains the prototypes for all the
Packit Service 82fcde
   actual math functions.  These macros are used for those prototypes,
Packit Service 82fcde
   so we can easily declare each function as both `name' and `__name',
Packit Service 82fcde
   and can declare the float versions `namef' and `__namef'.  */
Packit Service 82fcde
Packit Service 82fcde
#define __MATHCALL(function, args)	\
Packit Service 82fcde
  __MATHDECL (_Mdouble_complex_,function, args)
Packit Service 82fcde
#define __MATHDECL(type, function, args) \
Packit Service 82fcde
  __MATHDECL_1(type, function, args); \
Packit Service 82fcde
  __MATHDECL_1(type, __CONCAT(__,function), args)
Packit Service 82fcde
#define __MATHDECL_1(type, function, args) \
Packit Service 82fcde
  extern type __MATH_PRECNAME(function) args __THROW
Packit Service 82fcde
Packit Service 82fcde
#define _Mdouble_ 		double
Packit Service 82fcde
#define __MATH_PRECNAME(name)	name
Packit Service 82fcde
#include <bits/cmathcalls.h>
Packit Service 82fcde
#undef	_Mdouble_
Packit Service 82fcde
#undef	__MATH_PRECNAME
Packit Service 82fcde
Packit Service 82fcde
/* Now the float versions.  */
Packit Service 82fcde
#define _Mdouble_ 		float
Packit Service 82fcde
#define __MATH_PRECNAME(name)	name##f
Packit Service 82fcde
#include <bits/cmathcalls.h>
Packit Service 82fcde
#undef	_Mdouble_
Packit Service 82fcde
#undef	__MATH_PRECNAME
Packit Service 82fcde
Packit Service 82fcde
/* And the long double versions.  It is non-critical to define them
Packit Service 82fcde
   here unconditionally since `long double' is required in ISO C99.  */
Packit Service 82fcde
#if !(defined __NO_LONG_DOUBLE_MATH && defined _LIBC)	\
Packit Service 82fcde
    || defined __LDBL_COMPAT
Packit Service 82fcde
# ifdef __LDBL_COMPAT
Packit Service 82fcde
#  undef __MATHDECL_1
Packit Service 82fcde
#  define __MATHDECL_1(type, function, args) \
Packit Service 82fcde
  extern type __REDIRECT_NTH(__MATH_PRECNAME(function), args, function)
Packit Service 82fcde
# endif
Packit Service 82fcde
Packit Service 82fcde
# define _Mdouble_ 		long double
Packit Service 82fcde
# define __MATH_PRECNAME(name)	name##l
Packit Service 82fcde
# include <bits/cmathcalls.h>
Packit Service 82fcde
#endif
Packit Service 82fcde
#undef	_Mdouble_
Packit Service 82fcde
#undef	__MATH_PRECNAME
Packit Service 82fcde
Packit Service 82fcde
#if (__HAVE_DISTINCT_FLOAT16 || (__HAVE_FLOAT16 && !defined _LIBC)) \
Packit Service 82fcde
     && __GLIBC_USE (IEC_60559_TYPES_EXT)
Packit Service 82fcde
# undef _Mdouble_complex_
Packit Service 82fcde
# define _Mdouble_complex_	__CFLOAT16
Packit Service 82fcde
# define _Mdouble_		_Float16
Packit Service 82fcde
# define __MATH_PRECNAME(name)	name##f16
Packit Service 82fcde
# include <bits/cmathcalls.h>
Packit Service 82fcde
# undef _Mdouble_
Packit Service 82fcde
# undef __MATH_PRECNAME
Packit Service 82fcde
# undef _Mdouble_complex_
Packit Service 82fcde
#endif
Packit Service 82fcde
Packit Service 82fcde
#if (__HAVE_DISTINCT_FLOAT32 || (__HAVE_FLOAT32 && !defined _LIBC)) \
Packit Service 82fcde
     && __GLIBC_USE (IEC_60559_TYPES_EXT)
Packit Service 82fcde
# undef _Mdouble_complex_
Packit Service 82fcde
# define _Mdouble_complex_	__CFLOAT32
Packit Service 82fcde
# define _Mdouble_		_Float32
Packit Service 82fcde
# define __MATH_PRECNAME(name)	name##f32
Packit Service 82fcde
# include <bits/cmathcalls.h>
Packit Service 82fcde
# undef _Mdouble_
Packit Service 82fcde
# undef __MATH_PRECNAME
Packit Service 82fcde
# undef _Mdouble_complex_
Packit Service 82fcde
#endif
Packit Service 82fcde
Packit Service 82fcde
#if (__HAVE_DISTINCT_FLOAT64 || (__HAVE_FLOAT64 && !defined _LIBC)) \
Packit Service 82fcde
     && __GLIBC_USE (IEC_60559_TYPES_EXT)
Packit Service 82fcde
# undef _Mdouble_complex_
Packit Service 82fcde
# define _Mdouble_complex_	__CFLOAT64
Packit Service 82fcde
# define _Mdouble_		_Float64
Packit Service 82fcde
# define __MATH_PRECNAME(name)	name##f64
Packit Service 82fcde
# include <bits/cmathcalls.h>
Packit Service 82fcde
# undef _Mdouble_
Packit Service 82fcde
# undef __MATH_PRECNAME
Packit Service 82fcde
# undef _Mdouble_complex_
Packit Service 82fcde
#endif
Packit Service 82fcde
Packit Service 82fcde
#if (__HAVE_DISTINCT_FLOAT128 || (__HAVE_FLOAT128 && !defined _LIBC)) \
Packit Service 82fcde
     && __GLIBC_USE (IEC_60559_TYPES_EXT)
Packit Service 82fcde
# undef _Mdouble_complex_
Packit Service 82fcde
# define _Mdouble_complex_	__CFLOAT128
Packit Service 82fcde
# define _Mdouble_		_Float128
Packit Service 82fcde
# define __MATH_PRECNAME(name)	name##f128
Packit Service 82fcde
# include <bits/cmathcalls.h>
Packit Service 82fcde
# undef _Mdouble_
Packit Service 82fcde
# undef __MATH_PRECNAME
Packit Service 82fcde
# undef _Mdouble_complex_
Packit Service 82fcde
#endif
Packit Service 82fcde
Packit Service 82fcde
#if (__HAVE_DISTINCT_FLOAT32X || (__HAVE_FLOAT32X && !defined _LIBC)) \
Packit Service 82fcde
     && __GLIBC_USE (IEC_60559_TYPES_EXT)
Packit Service 82fcde
# undef _Mdouble_complex_
Packit Service 82fcde
# define _Mdouble_complex_	__CFLOAT32X
Packit Service 82fcde
# define _Mdouble_		_Float32x
Packit Service 82fcde
# define __MATH_PRECNAME(name)	name##f32x
Packit Service 82fcde
# include <bits/cmathcalls.h>
Packit Service 82fcde
# undef _Mdouble_
Packit Service 82fcde
# undef __MATH_PRECNAME
Packit Service 82fcde
# undef _Mdouble_complex_
Packit Service 82fcde
#endif
Packit Service 82fcde
Packit Service 82fcde
#if (__HAVE_DISTINCT_FLOAT64X || (__HAVE_FLOAT64X && !defined _LIBC)) \
Packit Service 82fcde
     && __GLIBC_USE (IEC_60559_TYPES_EXT)
Packit Service 82fcde
# undef _Mdouble_complex_
Packit Service 82fcde
# define _Mdouble_complex_	__CFLOAT64X
Packit Service 82fcde
# define _Mdouble_		_Float64x
Packit Service 82fcde
# define __MATH_PRECNAME(name)	name##f64x
Packit Service 82fcde
# include <bits/cmathcalls.h>
Packit Service 82fcde
# undef _Mdouble_
Packit Service 82fcde
# undef __MATH_PRECNAME
Packit Service 82fcde
# undef _Mdouble_complex_
Packit Service 82fcde
#endif
Packit Service 82fcde
Packit Service 82fcde
#if (__HAVE_DISTINCT_FLOAT128X || (__HAVE_FLOAT128X && !defined _LIBC)) \
Packit Service 82fcde
     && __GLIBC_USE (IEC_60559_TYPES_EXT)
Packit Service 82fcde
# undef _Mdouble_complex_
Packit Service 82fcde
# define _Mdouble_complex_	__CFLOAT128X
Packit Service 82fcde
# define _Mdouble_		_Float128x
Packit Service 82fcde
# define __MATH_PRECNAME(name)	name##f128x
Packit Service 82fcde
# include <bits/cmathcalls.h>
Packit Service 82fcde
# undef _Mdouble_
Packit Service 82fcde
# undef __MATH_PRECNAME
Packit Service 82fcde
# undef _Mdouble_complex_
Packit Service 82fcde
#endif
Packit Service 82fcde
Packit Service 82fcde
#undef	__MATHDECL_1
Packit Service 82fcde
#undef	__MATHDECL
Packit Service 82fcde
#undef	__MATHCALL
Packit Service 82fcde
Packit Service 82fcde
__END_DECLS
Packit Service 82fcde
Packit Service 82fcde
#endif /* complex.h */