2011-02-12 05:22:29 +00:00
|
|
|
#ifndef _MATH_H
|
|
|
|
#define _MATH_H
|
|
|
|
|
2011-11-11 01:40:06 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2012-09-08 03:13:55 +00:00
|
|
|
#include <features.h>
|
2012-09-02 16:46:06 +00:00
|
|
|
|
2012-02-16 02:47:55 +00:00
|
|
|
#define __NEED_float_t
|
|
|
|
#define __NEED_double_t
|
2011-02-12 05:22:29 +00:00
|
|
|
#include <bits/alltypes.h>
|
|
|
|
|
2012-03-03 03:35:37 +00:00
|
|
|
#if 100*__GNUC__+__GNUC_MINOR__ >= 303
|
|
|
|
#define NAN __builtin_nanf("")
|
|
|
|
#define INFINITY __builtin_inff()
|
|
|
|
#else
|
|
|
|
#define NAN (0.0f/0.0f)
|
2013-11-27 04:26:37 +00:00
|
|
|
#define INFINITY 1e5000f
|
2012-03-03 03:35:37 +00:00
|
|
|
#endif
|
2011-02-12 05:22:29 +00:00
|
|
|
|
|
|
|
#define HUGE_VALF INFINITY
|
|
|
|
#define HUGE_VAL ((double)INFINITY)
|
|
|
|
#define HUGE_VALL ((long double)INFINITY)
|
|
|
|
|
|
|
|
#define MATH_ERRNO 1
|
2012-04-18 15:41:04 +00:00
|
|
|
#define MATH_ERREXCEPT 2
|
2011-02-12 05:22:29 +00:00
|
|
|
#define math_errhandling 2
|
|
|
|
|
2018-08-22 23:11:58 +00:00
|
|
|
#define FP_ILOGBNAN (-1-0x7fffffff)
|
2012-05-06 02:22:46 +00:00
|
|
|
#define FP_ILOGB0 FP_ILOGBNAN
|
2011-02-12 05:22:29 +00:00
|
|
|
|
|
|
|
#define FP_NAN 0
|
|
|
|
#define FP_INFINITE 1
|
|
|
|
#define FP_ZERO 2
|
|
|
|
#define FP_SUBNORMAL 3
|
|
|
|
#define FP_NORMAL 4
|
|
|
|
|
|
|
|
int __fpclassify(double);
|
2012-03-13 05:17:53 +00:00
|
|
|
int __fpclassifyf(float);
|
2011-02-12 05:22:29 +00:00
|
|
|
int __fpclassifyl(long double);
|
|
|
|
|
refactor headers, especially alltypes.h, and improve C++ ABI compat
the arch-specific bits/alltypes.h.sh has been replaced with a generic
alltypes.h.in and minimal arch-specific bits/alltypes.h.in.
this commit is intended to have no functional changes except:
- exposing additional symbols that POSIX allows but does not require
- changing the C++ name mangling for some types
- fixing the signedness of blksize_t on powerpc (POSIX requires signed)
- fixing the limit macros for sig_atomic_t on x86_64
- making dev_t an unsigned type (ABI matching goal, and more logical)
in addition, some types that were wrongly defined with long on 32-bit
archs were changed to int, and vice versa; this change is
non-functional except for the possibility of making pointer types
mismatch, and only affects programs that were using them incorrectly,
and only at build-time, not runtime.
the following changes were made in the interest of moving
non-arch-specific types out of the alltypes system and into the
headers they're associated with, and also will tend to improve
application compatibility:
- netdb.h now includes netinet/in.h (for socklen_t and uint32_t)
- netinet/in.h now includes sys/socket.h and inttypes.h
- sys/resource.h now includes sys/time.h (for struct timeval)
- sys/wait.h now includes signal.h (for siginfo_t)
- langinfo.h now includes nl_types.h (for nl_item)
for the types in stdint.h:
- types which are of no interest to other headers were moved out of
the alltypes system.
- fast types for 8- and 64-bit are hard-coded (at least for now); only
the 16- and 32-bit ones have reason to vary by arch.
and the following types have been changed for C++ ABI purposes;
- mbstate_t now has a struct tag, __mbstate_t
- FILE's struct tag has been changed to _IO_FILE
- DIR's struct tag has been changed to __dirstream
- locale_t's struct tag has been changed to __locale_struct
- pthread_t is defined as unsigned long in C++ mode only
- fpos_t now has a struct tag, _G_fpos64_t
- fsid_t's struct tag has been changed to __fsid_t
- idtype_t has been made an enum type (also required by POSIX)
- nl_catd has been changed from long to void *
- siginfo_t's struct tag has been removed
- sigset_t's has been given a struct tag, __sigset_t
- stack_t has been given a struct tag, sigaltstack
- suseconds_t has been changed to long on 32-bit archs
- [u]intptr_t have been changed from long to int rank on 32-bit archs
- dev_t has been made unsigned
summary of tests that have been performed against these changes:
- nsz's libc-test (diff -u before and after)
- C++ ABI check symbol dump (diff -u before, after, glibc)
- grepped for __NEED, made sure types needed are still in alltypes
- built gcc 3.4.6
2013-07-22 15:22:36 +00:00
|
|
|
static __inline unsigned __FLOAT_BITS(float __f)
|
2013-05-06 17:52:48 +00:00
|
|
|
{
|
2014-03-09 18:29:41 +00:00
|
|
|
union {float __f; unsigned __i;} __u;
|
|
|
|
__u.__f = __f;
|
2013-05-06 17:52:48 +00:00
|
|
|
return __u.__i;
|
|
|
|
}
|
refactor headers, especially alltypes.h, and improve C++ ABI compat
the arch-specific bits/alltypes.h.sh has been replaced with a generic
alltypes.h.in and minimal arch-specific bits/alltypes.h.in.
this commit is intended to have no functional changes except:
- exposing additional symbols that POSIX allows but does not require
- changing the C++ name mangling for some types
- fixing the signedness of blksize_t on powerpc (POSIX requires signed)
- fixing the limit macros for sig_atomic_t on x86_64
- making dev_t an unsigned type (ABI matching goal, and more logical)
in addition, some types that were wrongly defined with long on 32-bit
archs were changed to int, and vice versa; this change is
non-functional except for the possibility of making pointer types
mismatch, and only affects programs that were using them incorrectly,
and only at build-time, not runtime.
the following changes were made in the interest of moving
non-arch-specific types out of the alltypes system and into the
headers they're associated with, and also will tend to improve
application compatibility:
- netdb.h now includes netinet/in.h (for socklen_t and uint32_t)
- netinet/in.h now includes sys/socket.h and inttypes.h
- sys/resource.h now includes sys/time.h (for struct timeval)
- sys/wait.h now includes signal.h (for siginfo_t)
- langinfo.h now includes nl_types.h (for nl_item)
for the types in stdint.h:
- types which are of no interest to other headers were moved out of
the alltypes system.
- fast types for 8- and 64-bit are hard-coded (at least for now); only
the 16- and 32-bit ones have reason to vary by arch.
and the following types have been changed for C++ ABI purposes;
- mbstate_t now has a struct tag, __mbstate_t
- FILE's struct tag has been changed to _IO_FILE
- DIR's struct tag has been changed to __dirstream
- locale_t's struct tag has been changed to __locale_struct
- pthread_t is defined as unsigned long in C++ mode only
- fpos_t now has a struct tag, _G_fpos64_t
- fsid_t's struct tag has been changed to __fsid_t
- idtype_t has been made an enum type (also required by POSIX)
- nl_catd has been changed from long to void *
- siginfo_t's struct tag has been removed
- sigset_t's has been given a struct tag, __sigset_t
- stack_t has been given a struct tag, sigaltstack
- suseconds_t has been changed to long on 32-bit archs
- [u]intptr_t have been changed from long to int rank on 32-bit archs
- dev_t has been made unsigned
summary of tests that have been performed against these changes:
- nsz's libc-test (diff -u before and after)
- C++ ABI check symbol dump (diff -u before, after, glibc)
- grepped for __NEED, made sure types needed are still in alltypes
- built gcc 3.4.6
2013-07-22 15:22:36 +00:00
|
|
|
static __inline unsigned long long __DOUBLE_BITS(double __f)
|
2013-05-06 17:52:48 +00:00
|
|
|
{
|
2014-03-09 18:29:41 +00:00
|
|
|
union {double __f; unsigned long long __i;} __u;
|
|
|
|
__u.__f = __f;
|
2013-05-06 17:52:48 +00:00
|
|
|
return __u.__i;
|
|
|
|
}
|
2012-03-13 05:17:53 +00:00
|
|
|
|
2011-02-12 05:22:29 +00:00
|
|
|
#define fpclassify(x) ( \
|
|
|
|
sizeof(x) == sizeof(float) ? __fpclassifyf(x) : \
|
|
|
|
sizeof(x) == sizeof(double) ? __fpclassify(x) : \
|
|
|
|
__fpclassifyl(x) )
|
|
|
|
|
2012-03-13 05:17:53 +00:00
|
|
|
#define isinf(x) ( \
|
|
|
|
sizeof(x) == sizeof(float) ? (__FLOAT_BITS(x) & 0x7fffffff) == 0x7f800000 : \
|
refactor headers, especially alltypes.h, and improve C++ ABI compat
the arch-specific bits/alltypes.h.sh has been replaced with a generic
alltypes.h.in and minimal arch-specific bits/alltypes.h.in.
this commit is intended to have no functional changes except:
- exposing additional symbols that POSIX allows but does not require
- changing the C++ name mangling for some types
- fixing the signedness of blksize_t on powerpc (POSIX requires signed)
- fixing the limit macros for sig_atomic_t on x86_64
- making dev_t an unsigned type (ABI matching goal, and more logical)
in addition, some types that were wrongly defined with long on 32-bit
archs were changed to int, and vice versa; this change is
non-functional except for the possibility of making pointer types
mismatch, and only affects programs that were using them incorrectly,
and only at build-time, not runtime.
the following changes were made in the interest of moving
non-arch-specific types out of the alltypes system and into the
headers they're associated with, and also will tend to improve
application compatibility:
- netdb.h now includes netinet/in.h (for socklen_t and uint32_t)
- netinet/in.h now includes sys/socket.h and inttypes.h
- sys/resource.h now includes sys/time.h (for struct timeval)
- sys/wait.h now includes signal.h (for siginfo_t)
- langinfo.h now includes nl_types.h (for nl_item)
for the types in stdint.h:
- types which are of no interest to other headers were moved out of
the alltypes system.
- fast types for 8- and 64-bit are hard-coded (at least for now); only
the 16- and 32-bit ones have reason to vary by arch.
and the following types have been changed for C++ ABI purposes;
- mbstate_t now has a struct tag, __mbstate_t
- FILE's struct tag has been changed to _IO_FILE
- DIR's struct tag has been changed to __dirstream
- locale_t's struct tag has been changed to __locale_struct
- pthread_t is defined as unsigned long in C++ mode only
- fpos_t now has a struct tag, _G_fpos64_t
- fsid_t's struct tag has been changed to __fsid_t
- idtype_t has been made an enum type (also required by POSIX)
- nl_catd has been changed from long to void *
- siginfo_t's struct tag has been removed
- sigset_t's has been given a struct tag, __sigset_t
- stack_t has been given a struct tag, sigaltstack
- suseconds_t has been changed to long on 32-bit archs
- [u]intptr_t have been changed from long to int rank on 32-bit archs
- dev_t has been made unsigned
summary of tests that have been performed against these changes:
- nsz's libc-test (diff -u before and after)
- C++ ABI check symbol dump (diff -u before, after, glibc)
- grepped for __NEED, made sure types needed are still in alltypes
- built gcc 3.4.6
2013-07-22 15:22:36 +00:00
|
|
|
sizeof(x) == sizeof(double) ? (__DOUBLE_BITS(x) & -1ULL>>1) == 0x7ffULL<<52 : \
|
2012-03-13 05:17:53 +00:00
|
|
|
__fpclassifyl(x) == FP_INFINITE)
|
|
|
|
|
|
|
|
#define isnan(x) ( \
|
|
|
|
sizeof(x) == sizeof(float) ? (__FLOAT_BITS(x) & 0x7fffffff) > 0x7f800000 : \
|
refactor headers, especially alltypes.h, and improve C++ ABI compat
the arch-specific bits/alltypes.h.sh has been replaced with a generic
alltypes.h.in and minimal arch-specific bits/alltypes.h.in.
this commit is intended to have no functional changes except:
- exposing additional symbols that POSIX allows but does not require
- changing the C++ name mangling for some types
- fixing the signedness of blksize_t on powerpc (POSIX requires signed)
- fixing the limit macros for sig_atomic_t on x86_64
- making dev_t an unsigned type (ABI matching goal, and more logical)
in addition, some types that were wrongly defined with long on 32-bit
archs were changed to int, and vice versa; this change is
non-functional except for the possibility of making pointer types
mismatch, and only affects programs that were using them incorrectly,
and only at build-time, not runtime.
the following changes were made in the interest of moving
non-arch-specific types out of the alltypes system and into the
headers they're associated with, and also will tend to improve
application compatibility:
- netdb.h now includes netinet/in.h (for socklen_t and uint32_t)
- netinet/in.h now includes sys/socket.h and inttypes.h
- sys/resource.h now includes sys/time.h (for struct timeval)
- sys/wait.h now includes signal.h (for siginfo_t)
- langinfo.h now includes nl_types.h (for nl_item)
for the types in stdint.h:
- types which are of no interest to other headers were moved out of
the alltypes system.
- fast types for 8- and 64-bit are hard-coded (at least for now); only
the 16- and 32-bit ones have reason to vary by arch.
and the following types have been changed for C++ ABI purposes;
- mbstate_t now has a struct tag, __mbstate_t
- FILE's struct tag has been changed to _IO_FILE
- DIR's struct tag has been changed to __dirstream
- locale_t's struct tag has been changed to __locale_struct
- pthread_t is defined as unsigned long in C++ mode only
- fpos_t now has a struct tag, _G_fpos64_t
- fsid_t's struct tag has been changed to __fsid_t
- idtype_t has been made an enum type (also required by POSIX)
- nl_catd has been changed from long to void *
- siginfo_t's struct tag has been removed
- sigset_t's has been given a struct tag, __sigset_t
- stack_t has been given a struct tag, sigaltstack
- suseconds_t has been changed to long on 32-bit archs
- [u]intptr_t have been changed from long to int rank on 32-bit archs
- dev_t has been made unsigned
summary of tests that have been performed against these changes:
- nsz's libc-test (diff -u before and after)
- C++ ABI check symbol dump (diff -u before, after, glibc)
- grepped for __NEED, made sure types needed are still in alltypes
- built gcc 3.4.6
2013-07-22 15:22:36 +00:00
|
|
|
sizeof(x) == sizeof(double) ? (__DOUBLE_BITS(x) & -1ULL>>1) > 0x7ffULL<<52 : \
|
2012-03-13 05:17:53 +00:00
|
|
|
__fpclassifyl(x) == FP_NAN)
|
|
|
|
|
|
|
|
#define isnormal(x) ( \
|
|
|
|
sizeof(x) == sizeof(float) ? ((__FLOAT_BITS(x)+0x00800000) & 0x7fffffff) >= 0x01000000 : \
|
refactor headers, especially alltypes.h, and improve C++ ABI compat
the arch-specific bits/alltypes.h.sh has been replaced with a generic
alltypes.h.in and minimal arch-specific bits/alltypes.h.in.
this commit is intended to have no functional changes except:
- exposing additional symbols that POSIX allows but does not require
- changing the C++ name mangling for some types
- fixing the signedness of blksize_t on powerpc (POSIX requires signed)
- fixing the limit macros for sig_atomic_t on x86_64
- making dev_t an unsigned type (ABI matching goal, and more logical)
in addition, some types that were wrongly defined with long on 32-bit
archs were changed to int, and vice versa; this change is
non-functional except for the possibility of making pointer types
mismatch, and only affects programs that were using them incorrectly,
and only at build-time, not runtime.
the following changes were made in the interest of moving
non-arch-specific types out of the alltypes system and into the
headers they're associated with, and also will tend to improve
application compatibility:
- netdb.h now includes netinet/in.h (for socklen_t and uint32_t)
- netinet/in.h now includes sys/socket.h and inttypes.h
- sys/resource.h now includes sys/time.h (for struct timeval)
- sys/wait.h now includes signal.h (for siginfo_t)
- langinfo.h now includes nl_types.h (for nl_item)
for the types in stdint.h:
- types which are of no interest to other headers were moved out of
the alltypes system.
- fast types for 8- and 64-bit are hard-coded (at least for now); only
the 16- and 32-bit ones have reason to vary by arch.
and the following types have been changed for C++ ABI purposes;
- mbstate_t now has a struct tag, __mbstate_t
- FILE's struct tag has been changed to _IO_FILE
- DIR's struct tag has been changed to __dirstream
- locale_t's struct tag has been changed to __locale_struct
- pthread_t is defined as unsigned long in C++ mode only
- fpos_t now has a struct tag, _G_fpos64_t
- fsid_t's struct tag has been changed to __fsid_t
- idtype_t has been made an enum type (also required by POSIX)
- nl_catd has been changed from long to void *
- siginfo_t's struct tag has been removed
- sigset_t's has been given a struct tag, __sigset_t
- stack_t has been given a struct tag, sigaltstack
- suseconds_t has been changed to long on 32-bit archs
- [u]intptr_t have been changed from long to int rank on 32-bit archs
- dev_t has been made unsigned
summary of tests that have been performed against these changes:
- nsz's libc-test (diff -u before and after)
- C++ ABI check symbol dump (diff -u before, after, glibc)
- grepped for __NEED, made sure types needed are still in alltypes
- built gcc 3.4.6
2013-07-22 15:22:36 +00:00
|
|
|
sizeof(x) == sizeof(double) ? ((__DOUBLE_BITS(x)+(1ULL<<52)) & -1ULL>>1) >= 1ULL<<53 : \
|
2012-03-13 05:17:53 +00:00
|
|
|
__fpclassifyl(x) == FP_NORMAL)
|
2011-02-12 05:22:29 +00:00
|
|
|
|
2012-03-13 05:17:53 +00:00
|
|
|
#define isfinite(x) ( \
|
|
|
|
sizeof(x) == sizeof(float) ? (__FLOAT_BITS(x) & 0x7fffffff) < 0x7f800000 : \
|
refactor headers, especially alltypes.h, and improve C++ ABI compat
the arch-specific bits/alltypes.h.sh has been replaced with a generic
alltypes.h.in and minimal arch-specific bits/alltypes.h.in.
this commit is intended to have no functional changes except:
- exposing additional symbols that POSIX allows but does not require
- changing the C++ name mangling for some types
- fixing the signedness of blksize_t on powerpc (POSIX requires signed)
- fixing the limit macros for sig_atomic_t on x86_64
- making dev_t an unsigned type (ABI matching goal, and more logical)
in addition, some types that were wrongly defined with long on 32-bit
archs were changed to int, and vice versa; this change is
non-functional except for the possibility of making pointer types
mismatch, and only affects programs that were using them incorrectly,
and only at build-time, not runtime.
the following changes were made in the interest of moving
non-arch-specific types out of the alltypes system and into the
headers they're associated with, and also will tend to improve
application compatibility:
- netdb.h now includes netinet/in.h (for socklen_t and uint32_t)
- netinet/in.h now includes sys/socket.h and inttypes.h
- sys/resource.h now includes sys/time.h (for struct timeval)
- sys/wait.h now includes signal.h (for siginfo_t)
- langinfo.h now includes nl_types.h (for nl_item)
for the types in stdint.h:
- types which are of no interest to other headers were moved out of
the alltypes system.
- fast types for 8- and 64-bit are hard-coded (at least for now); only
the 16- and 32-bit ones have reason to vary by arch.
and the following types have been changed for C++ ABI purposes;
- mbstate_t now has a struct tag, __mbstate_t
- FILE's struct tag has been changed to _IO_FILE
- DIR's struct tag has been changed to __dirstream
- locale_t's struct tag has been changed to __locale_struct
- pthread_t is defined as unsigned long in C++ mode only
- fpos_t now has a struct tag, _G_fpos64_t
- fsid_t's struct tag has been changed to __fsid_t
- idtype_t has been made an enum type (also required by POSIX)
- nl_catd has been changed from long to void *
- siginfo_t's struct tag has been removed
- sigset_t's has been given a struct tag, __sigset_t
- stack_t has been given a struct tag, sigaltstack
- suseconds_t has been changed to long on 32-bit archs
- [u]intptr_t have been changed from long to int rank on 32-bit archs
- dev_t has been made unsigned
summary of tests that have been performed against these changes:
- nsz's libc-test (diff -u before and after)
- C++ ABI check symbol dump (diff -u before, after, glibc)
- grepped for __NEED, made sure types needed are still in alltypes
- built gcc 3.4.6
2013-07-22 15:22:36 +00:00
|
|
|
sizeof(x) == sizeof(double) ? (__DOUBLE_BITS(x) & -1ULL>>1) < 0x7ffULL<<52 : \
|
2012-03-13 05:17:53 +00:00
|
|
|
__fpclassifyl(x) > FP_INFINITE)
|
|
|
|
|
|
|
|
int __signbit(double);
|
|
|
|
int __signbitf(float);
|
|
|
|
int __signbitl(long double);
|
|
|
|
|
|
|
|
#define signbit(x) ( \
|
2012-03-31 03:41:43 +00:00
|
|
|
sizeof(x) == sizeof(float) ? (int)(__FLOAT_BITS(x)>>31) : \
|
|
|
|
sizeof(x) == sizeof(double) ? (int)(__DOUBLE_BITS(x)>>63) : \
|
2012-03-13 05:17:53 +00:00
|
|
|
__signbitl(x) )
|
|
|
|
|
|
|
|
#define isunordered(x,y) (isnan((x)) ? ((void)(y),1) : isnan((y)))
|
2011-06-08 20:33:04 +00:00
|
|
|
|
2012-12-05 19:12:57 +00:00
|
|
|
#define __ISREL_DEF(rel, op, type) \
|
|
|
|
static __inline int __is##rel(type __x, type __y) \
|
|
|
|
{ return !isunordered(__x,__y) && __x op __y; }
|
|
|
|
|
2013-09-27 13:55:29 +00:00
|
|
|
__ISREL_DEF(lessf, <, float_t)
|
|
|
|
__ISREL_DEF(less, <, double_t)
|
2012-12-05 19:12:57 +00:00
|
|
|
__ISREL_DEF(lessl, <, long double)
|
2013-09-27 13:55:29 +00:00
|
|
|
__ISREL_DEF(lessequalf, <=, float_t)
|
|
|
|
__ISREL_DEF(lessequal, <=, double_t)
|
2012-12-05 19:12:57 +00:00
|
|
|
__ISREL_DEF(lessequall, <=, long double)
|
2013-09-27 13:55:29 +00:00
|
|
|
__ISREL_DEF(lessgreaterf, !=, float_t)
|
|
|
|
__ISREL_DEF(lessgreater, !=, double_t)
|
2012-12-05 19:12:57 +00:00
|
|
|
__ISREL_DEF(lessgreaterl, !=, long double)
|
2013-09-27 13:55:29 +00:00
|
|
|
__ISREL_DEF(greaterf, >, float_t)
|
|
|
|
__ISREL_DEF(greater, >, double_t)
|
2012-12-05 19:12:57 +00:00
|
|
|
__ISREL_DEF(greaterl, >, long double)
|
2013-09-27 13:55:29 +00:00
|
|
|
__ISREL_DEF(greaterequalf, >=, float_t)
|
|
|
|
__ISREL_DEF(greaterequal, >=, double_t)
|
2012-12-05 19:12:57 +00:00
|
|
|
__ISREL_DEF(greaterequall, >=, long double)
|
|
|
|
|
|
|
|
#define __tg_pred_2(x, y, p) ( \
|
|
|
|
sizeof((x)+(y)) == sizeof(float) ? p##f(x, y) : \
|
|
|
|
sizeof((x)+(y)) == sizeof(double) ? p(x, y) : \
|
|
|
|
p##l(x, y) )
|
|
|
|
|
|
|
|
#define isless(x, y) __tg_pred_2(x, y, __isless)
|
|
|
|
#define islessequal(x, y) __tg_pred_2(x, y, __islessequal)
|
|
|
|
#define islessgreater(x, y) __tg_pred_2(x, y, __islessgreater)
|
|
|
|
#define isgreater(x, y) __tg_pred_2(x, y, __isgreater)
|
|
|
|
#define isgreaterequal(x, y) __tg_pred_2(x, y, __isgreaterequal)
|
2011-06-08 20:33:04 +00:00
|
|
|
|
2011-02-12 05:22:29 +00:00
|
|
|
double acos(double);
|
|
|
|
float acosf(float);
|
|
|
|
long double acosl(long double);
|
|
|
|
|
|
|
|
double acosh(double);
|
|
|
|
float acoshf(float);
|
|
|
|
long double acoshl(long double);
|
|
|
|
|
|
|
|
double asin(double);
|
|
|
|
float asinf(float);
|
|
|
|
long double asinl(long double);
|
|
|
|
|
|
|
|
double asinh(double);
|
|
|
|
float asinhf(float);
|
|
|
|
long double asinhl(long double);
|
|
|
|
|
|
|
|
double atan(double);
|
|
|
|
float atanf(float);
|
|
|
|
long double atanl(long double);
|
|
|
|
|
|
|
|
double atan2(double, double);
|
|
|
|
float atan2f(float, float);
|
|
|
|
long double atan2l(long double, long double);
|
|
|
|
|
|
|
|
double atanh(double);
|
|
|
|
float atanhf(float);
|
|
|
|
long double atanhl(long double);
|
|
|
|
|
|
|
|
double cbrt(double);
|
|
|
|
float cbrtf(float);
|
|
|
|
long double cbrtl(long double);
|
|
|
|
|
|
|
|
double ceil(double);
|
|
|
|
float ceilf(float);
|
|
|
|
long double ceill(long double);
|
|
|
|
|
|
|
|
double copysign(double, double);
|
|
|
|
float copysignf(float, float);
|
|
|
|
long double copysignl(long double, long double);
|
|
|
|
|
|
|
|
double cos(double);
|
|
|
|
float cosf(float);
|
|
|
|
long double cosl(long double);
|
|
|
|
|
|
|
|
double cosh(double);
|
|
|
|
float coshf(float);
|
|
|
|
long double coshl(long double);
|
|
|
|
|
|
|
|
double erf(double);
|
|
|
|
float erff(float);
|
|
|
|
long double erfl(long double);
|
|
|
|
|
|
|
|
double erfc(double);
|
|
|
|
float erfcf(float);
|
|
|
|
long double erfcl(long double);
|
|
|
|
|
|
|
|
double exp(double);
|
|
|
|
float expf(float);
|
|
|
|
long double expl(long double);
|
|
|
|
|
|
|
|
double exp2(double);
|
|
|
|
float exp2f(float);
|
|
|
|
long double exp2l(long double);
|
|
|
|
|
|
|
|
double expm1(double);
|
|
|
|
float expm1f(float);
|
|
|
|
long double expm1l(long double);
|
|
|
|
|
|
|
|
double fabs(double);
|
|
|
|
float fabsf(float);
|
|
|
|
long double fabsl(long double);
|
|
|
|
|
|
|
|
double fdim(double, double);
|
|
|
|
float fdimf(float, float);
|
|
|
|
long double fdiml(long double, long double);
|
|
|
|
|
|
|
|
double floor(double);
|
|
|
|
float floorf(float);
|
|
|
|
long double floorl(long double);
|
|
|
|
|
|
|
|
double fma(double, double, double);
|
|
|
|
float fmaf(float, float, float);
|
|
|
|
long double fmal(long double, long double, long double);
|
|
|
|
|
|
|
|
double fmax(double, double);
|
|
|
|
float fmaxf(float, float);
|
|
|
|
long double fmaxl(long double, long double);
|
|
|
|
|
|
|
|
double fmin(double, double);
|
|
|
|
float fminf(float, float);
|
|
|
|
long double fminl(long double, long double);
|
|
|
|
|
|
|
|
double fmod(double, double);
|
|
|
|
float fmodf(float, float);
|
|
|
|
long double fmodl(long double, long double);
|
|
|
|
|
|
|
|
double frexp(double, int *);
|
2012-07-22 23:02:02 +00:00
|
|
|
float frexpf(float, int *);
|
|
|
|
long double frexpl(long double, int *);
|
2011-02-12 05:22:29 +00:00
|
|
|
|
|
|
|
double hypot(double, double);
|
|
|
|
float hypotf(float, float);
|
|
|
|
long double hypotl(long double, long double);
|
|
|
|
|
|
|
|
int ilogb(double);
|
|
|
|
int ilogbf(float);
|
|
|
|
int ilogbl(long double);
|
|
|
|
|
|
|
|
double ldexp(double, int);
|
|
|
|
float ldexpf(float, int);
|
|
|
|
long double ldexpl(long double, int);
|
|
|
|
|
|
|
|
double lgamma(double);
|
|
|
|
float lgammaf(float);
|
|
|
|
long double lgammal(long double);
|
|
|
|
|
|
|
|
long long llrint(double);
|
|
|
|
long long llrintf(float);
|
|
|
|
long long llrintl(long double);
|
|
|
|
|
|
|
|
long long llround(double);
|
|
|
|
long long llroundf(float);
|
|
|
|
long long llroundl(long double);
|
|
|
|
|
|
|
|
double log(double);
|
|
|
|
float logf(float);
|
|
|
|
long double logl(long double);
|
|
|
|
|
|
|
|
double log10(double);
|
|
|
|
float log10f(float);
|
|
|
|
long double log10l(long double);
|
|
|
|
|
|
|
|
double log1p(double);
|
|
|
|
float log1pf(float);
|
|
|
|
long double log1pl(long double);
|
|
|
|
|
|
|
|
double log2(double);
|
|
|
|
float log2f(float);
|
|
|
|
long double log2l(long double);
|
|
|
|
|
|
|
|
double logb(double);
|
|
|
|
float logbf(float);
|
|
|
|
long double logbl(long double);
|
|
|
|
|
|
|
|
long lrint(double);
|
|
|
|
long lrintf(float);
|
|
|
|
long lrintl(long double);
|
|
|
|
|
|
|
|
long lround(double);
|
|
|
|
long lroundf(float);
|
|
|
|
long lroundl(long double);
|
|
|
|
|
|
|
|
double modf(double, double *);
|
|
|
|
float modff(float, float *);
|
|
|
|
long double modfl(long double, long double *);
|
|
|
|
|
|
|
|
double nan(const char *);
|
|
|
|
float nanf(const char *);
|
|
|
|
long double nanl(const char *);
|
|
|
|
|
|
|
|
double nearbyint(double);
|
|
|
|
float nearbyintf(float);
|
|
|
|
long double nearbyintl(long double);
|
|
|
|
|
|
|
|
double nextafter(double, double);
|
|
|
|
float nextafterf(float, float);
|
|
|
|
long double nextafterl(long double, long double);
|
|
|
|
|
|
|
|
double nexttoward(double, long double);
|
|
|
|
float nexttowardf(float, long double);
|
|
|
|
long double nexttowardl(long double, long double);
|
|
|
|
|
|
|
|
double pow(double, double);
|
|
|
|
float powf(float, float);
|
|
|
|
long double powl(long double, long double);
|
|
|
|
|
|
|
|
double remainder(double, double);
|
|
|
|
float remainderf(float, float);
|
|
|
|
long double remainderl(long double, long double);
|
|
|
|
|
|
|
|
double remquo(double, double, int *);
|
|
|
|
float remquof(float, float, int *);
|
|
|
|
long double remquol(long double, long double, int *);
|
|
|
|
|
|
|
|
double rint(double);
|
|
|
|
float rintf(float);
|
|
|
|
long double rintl(long double);
|
|
|
|
|
|
|
|
double round(double);
|
|
|
|
float roundf(float);
|
|
|
|
long double roundl(long double);
|
|
|
|
|
|
|
|
double scalbln(double, long);
|
|
|
|
float scalblnf(float, long);
|
|
|
|
long double scalblnl(long double, long);
|
|
|
|
|
|
|
|
double scalbn(double, int);
|
|
|
|
float scalbnf(float, int);
|
|
|
|
long double scalbnl(long double, int);
|
|
|
|
|
|
|
|
double sin(double);
|
|
|
|
float sinf(float);
|
|
|
|
long double sinl(long double);
|
|
|
|
|
|
|
|
double sinh(double);
|
|
|
|
float sinhf(float);
|
|
|
|
long double sinhl(long double);
|
|
|
|
|
|
|
|
double sqrt(double);
|
|
|
|
float sqrtf(float);
|
|
|
|
long double sqrtl(long double);
|
|
|
|
|
|
|
|
double tan(double);
|
|
|
|
float tanf(float);
|
|
|
|
long double tanl(long double);
|
|
|
|
|
|
|
|
double tanh(double);
|
|
|
|
float tanhf(float);
|
|
|
|
long double tanhl(long double);
|
|
|
|
|
|
|
|
double tgamma(double);
|
|
|
|
float tgammaf(float);
|
|
|
|
long double tgammal(long double);
|
|
|
|
|
|
|
|
double trunc(double);
|
|
|
|
float truncf(float);
|
|
|
|
long double truncl(long double);
|
|
|
|
|
2012-08-13 20:06:01 +00:00
|
|
|
|
|
|
|
#if defined(_XOPEN_SOURCE) || defined(_BSD_SOURCE)
|
2013-01-04 12:05:42 +00:00
|
|
|
#undef MAXFLOAT
|
2013-11-20 22:40:33 +00:00
|
|
|
#define MAXFLOAT 3.40282346638528859812e+38F
|
2012-08-13 20:06:01 +00:00
|
|
|
#endif
|
|
|
|
|
2012-05-23 01:52:08 +00:00
|
|
|
#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
|
2011-02-14 23:41:25 +00:00
|
|
|
#define M_E 2.7182818284590452354 /* e */
|
|
|
|
#define M_LOG2E 1.4426950408889634074 /* log_2 e */
|
|
|
|
#define M_LOG10E 0.43429448190325182765 /* log_10 e */
|
|
|
|
#define M_LN2 0.69314718055994530942 /* log_e 2 */
|
|
|
|
#define M_LN10 2.30258509299404568402 /* log_e 10 */
|
|
|
|
#define M_PI 3.14159265358979323846 /* pi */
|
|
|
|
#define M_PI_2 1.57079632679489661923 /* pi/2 */
|
|
|
|
#define M_PI_4 0.78539816339744830962 /* pi/4 */
|
|
|
|
#define M_1_PI 0.31830988618379067154 /* 1/pi */
|
|
|
|
#define M_2_PI 0.63661977236758134308 /* 2/pi */
|
|
|
|
#define M_2_SQRTPI 1.12837916709551257390 /* 2/sqrt(pi) */
|
|
|
|
#define M_SQRT2 1.41421356237309504880 /* sqrt(2) */
|
|
|
|
#define M_SQRT1_2 0.70710678118654752440 /* 1/sqrt(2) */
|
2012-03-13 05:17:53 +00:00
|
|
|
|
|
|
|
extern int signgam;
|
|
|
|
|
2011-02-12 05:22:29 +00:00
|
|
|
double j0(double);
|
|
|
|
double j1(double);
|
|
|
|
double jn(int, double);
|
2012-03-13 05:17:53 +00:00
|
|
|
|
2011-02-12 05:22:29 +00:00
|
|
|
double y0(double);
|
|
|
|
double y1(double);
|
|
|
|
double yn(int, double);
|
2011-02-14 23:41:25 +00:00
|
|
|
#endif
|
|
|
|
|
2012-08-13 20:06:01 +00:00
|
|
|
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
|
2013-11-20 22:40:33 +00:00
|
|
|
#define HUGE 3.40282346638528859812e+38F
|
2012-08-13 20:06:01 +00:00
|
|
|
|
2013-11-21 01:16:49 +00:00
|
|
|
double drem(double, double);
|
|
|
|
float dremf(float, float);
|
|
|
|
|
|
|
|
int finite(double);
|
|
|
|
int finitef(float);
|
|
|
|
|
2011-02-14 23:41:25 +00:00
|
|
|
double scalb(double, double);
|
2012-03-13 05:17:53 +00:00
|
|
|
float scalbf(float, float);
|
2012-03-15 07:17:28 +00:00
|
|
|
|
2012-08-13 20:06:01 +00:00
|
|
|
double significand(double);
|
|
|
|
float significandf(float);
|
2012-03-18 01:48:48 +00:00
|
|
|
|
2012-03-15 08:29:53 +00:00
|
|
|
double lgamma_r(double, int*);
|
|
|
|
float lgammaf_r(float, int*);
|
|
|
|
|
|
|
|
float j0f(float);
|
|
|
|
float j1f(float);
|
|
|
|
float jnf(int, float);
|
|
|
|
|
|
|
|
float y0f(float);
|
|
|
|
float y1f(float);
|
|
|
|
float ynf(int, float);
|
2012-08-13 20:06:01 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef _GNU_SOURCE
|
|
|
|
long double lgammal_r(long double, int*);
|
|
|
|
|
|
|
|
void sincos(double, double*, double*);
|
|
|
|
void sincosf(float, float*, float*);
|
|
|
|
void sincosl(long double, long double*, long double*);
|
|
|
|
|
2012-04-30 07:26:53 +00:00
|
|
|
double exp10(double);
|
|
|
|
float exp10f(float);
|
|
|
|
long double exp10l(long double);
|
2012-08-13 20:06:01 +00:00
|
|
|
|
2012-05-01 04:07:37 +00:00
|
|
|
double pow10(double);
|
|
|
|
float pow10f(float);
|
|
|
|
long double pow10l(long double);
|
2011-02-14 23:41:25 +00:00
|
|
|
#endif
|
2011-02-12 05:22:29 +00:00
|
|
|
|
2011-11-11 01:40:06 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2011-02-12 05:22:29 +00:00
|
|
|
#endif
|