mirror of
https://sourceware.org/git/glibc.git
synced 2024-12-23 03:10:05 +00:00
233963756b
Thu Aug 8 01:41:43 1996 Ulrich Drepper <drepper@cygnus.com> * elf/Makefile: Undo change of Tue Aug 6 14:27:11 1996. * elf/dl-support: Add definition of `_dl_sysdep_read_whole_file'. Thu Aug 8 01:15:59 1996 Ulrich Drepper <drepper@cygnus.com> * sysdeps/i386/fpu_control.h (_FPU_DEFAULT, _FPU_IEEE): Set to 0x137f to allow long double operations. Sun Aug 4 13:12:05 1996 Richard Henderson <rth@tamu.edu> Bug Fixes: * nss/nsswitch.c (_res): Remove redundant variable definition. The real one is in resolve/res_init.c, and having both prevents using -fno-common when building the shared library. * sunrpc/rpc_prot.c (_null_auth): Same. Original is in rpc_common.c. * sysdeps/unix/sysv/linux/alpha/brk.S: When PIC, define __curbrk as a .bss object not a COMMON symbol. * sysdeps/alpha/bsd-_setjmp.S, sysdeps/alpha/bsd-setjmp.S: Must load $gp before referencing __sigsetjmp symbol. Retain LITUSE for same. Optimizations: * sysdeps/alpha/strlen.S: Rearrange first-word setup and thense the main loop for better dual-issue on EV5. Rearrange binary search to pipeline better and trim one instruction. Cosmetic Changes: * time/localtime.c (localtime_r): Move lock declaration back next to the comment where it was before the 960724 change. * INSTALL, manual/maint.texi: alpha-gnu-linux -> alpha-ANYTHING-linux. The second word is supposed to be the hardware manufacturer. * sysdeps/alpha/_mcount.S: Retain LITUSE for __mcount. * sysdeps/alpha/setjmp.S: Retain LITUSE for __sigsetjmp_aux. * sysdeps/alpha/divrem.h: More local labels, retain LITUSE for _mcount. * sysdeps/alpha/alphaev5/add_n.S, sysdeps/alpha/alphaev5/lshift.S, sysdeps/alpha/alphaev5/rshift.S, sysdeps/alpha/alphaev5/sub_n.S: Same cleanups as with EV4 GMP stuff. Tue Jul 25 03:30:56 1996 Richard Henderson <rth@tamu.edu> * sysdeps/unix/sysv/linux/Makefile [misc] (sysdep_routines): Add clone. * sysdeps/unix/sysv/linux/alpha/clone.S: New file. * sysdeps/unix/sysv/linux/i386/clone.S: New file. Sun Aug 4 00:12:41 1996 David Mosberger-Tang <davidm@azstarnet.com> * sysdeps/unix/sysv/linux/gnu/types.h: Declare __fd_mask as `unsigned long'. * misc/sys/select.h: Declare fd_mask as alias of __fd_mask. Sat Aug 3 16:20:02 1996 David Mosberger-Tang <davidm@azstarnet.com> * sysdeps/unix/sysv/linux/alpha/ioperm.c (platform): Add entry for Mikasa. * socket/sys/socket.h (send, __send, sendto): Declare buffer pointer as __const. * string/tester.c (main): Test stpncpy. * sysdeps/generic/stpncpy.c (__stpncpy): Fix so it works without segfault when called with an N that is not a multiple of four and src[N-1]=='\0'. * misc/syslog.c (LogType): New variable. (openlog): If connect() with SOCK_DGRAM fails with EPROTOTYPE, try again with SOCK_STREAM (the Linux syslogd uses a socket of the latter type). (vsyslog): When LogType==SOCK_STREAM, also send ASCII NUL terminator as a record-delimiter. If __send(LogFile) fails, call closelog() so logfile gets re-opened next time. Wed Aug 7 15:15:14 1996 Ulrich Drepper <drepper@cygnus.com> * elf/dl-open (_dl_open): Add cast to avoid warning. * manual/memory.texi: Improve some examples to give readers better advice: Use `stpcpy' instead of `strcat' if possible. * manual/string.texi: Document `strtok_r' and `strtok'. * sunrpc/Makefile: Move `+gccwarn' definition before inclusion of Makeconfig. [$(cross-compiling)=no]: Change test before making librpcsvc to this from $(cross-compile). Reported by Andreas Schwab. Tue Aug 6 14:27:11 1996 Ulrich Drepper <drepper@cygnus.com> * elf/Makefile (routines): Move dl-sysdep to here... (rtld-routines): ...from here. This should make static linking work again. * locale/setlocale.c: Add local variable `lock' and add code to `setlocale' to avoid simultaneous changing of global data. * catgets/catgets.c (catopen): Use `__strdup' instead of `strdup'. * catgets/open_catalog (__open_catalog): Use `__stpcpy', `__open', `__fstat', `__read', `__mmap', `__munmap' and `__close' instead of unprotected names.
176 lines
5.1 KiB
C
176 lines
5.1 KiB
C
/* Declarations for math functions.
|
|
Copyright (C) 1991, 92, 93, 95, 96 Free Software Foundation, Inc.
|
|
This file is part of the GNU C Library.
|
|
|
|
The GNU C Library is free software; you can redistribute it and/or
|
|
modify it under the terms of the GNU Library General Public License as
|
|
published by the Free Software Foundation; either version 2 of the
|
|
License, or (at your option) any later version.
|
|
|
|
The GNU C Library is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Library General Public License for more details.
|
|
|
|
You should have received a copy of the GNU Library General Public
|
|
License along with the GNU C Library; see the file COPYING.LIB. If
|
|
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
|
|
Cambridge, MA 02139, USA. */
|
|
|
|
/*
|
|
* ANSI Standard: 4.5 MATHEMATICS <math.h>
|
|
*/
|
|
|
|
#ifndef _MATH_H
|
|
|
|
#define _MATH_H 1
|
|
#include <features.h>
|
|
|
|
__BEGIN_DECLS
|
|
|
|
#define __need_Emath
|
|
#include <errno.h>
|
|
|
|
/* Get machine-dependent HUGE_VAL value (returned on overflow).
|
|
On all IEEE754 machines, this is +Infinity. */
|
|
#include <huge_val.h>
|
|
|
|
/* Get machine-dependent NAN value (returned for some domain errors). */
|
|
#ifdef __USE_GNU
|
|
#include <nan.h>
|
|
#endif
|
|
|
|
|
|
/* The file <mathcalls.h> contains the prototypes for all the actual
|
|
math functions. These macros are used for those prototypes, so
|
|
we can easily declare each function as both `name' and `__name',
|
|
and can declare the float versions `namef' and `__namef'. */
|
|
|
|
#define __MATHCALL(function,suffix, args) \
|
|
__MATHDECL (_Mdouble_, function,suffix, args)
|
|
#define __MATHDECL(type, function,suffix, args) \
|
|
__MATHDECL_1(type, function,suffix, args); \
|
|
__MATHDECL_1(type, __##function,suffix, args)
|
|
#define __MATHDECL_1(type, function,suffix, args) \
|
|
extern type __MATH_PRECNAME(function,suffix) args
|
|
|
|
#define _Mdouble_ double
|
|
#define __MATH_PRECNAME(name,r) name##r
|
|
#include <mathcalls.h>
|
|
#undef _Mdouble_
|
|
#undef __MATH_PRECNAME
|
|
|
|
#ifdef __USE_MISC
|
|
|
|
|
|
/* Include the file of declarations again, this time using `float'
|
|
instead of `double' and appending f to each function name. */
|
|
|
|
#ifndef _Mfloat_
|
|
#define _Mfloat_ float
|
|
#endif
|
|
#define _Mdouble_ _Mfloat_
|
|
#define __MATH_PRECNAME(name,r) name##f##r
|
|
#include <mathcalls.h>
|
|
#undef _Mdouble_
|
|
#undef __MATH_PRECNAME
|
|
|
|
/* Include the file of declarations again, this time using `long double'
|
|
instead of `double' and appending l to each function name. */
|
|
|
|
#ifndef _Mlong_double_
|
|
#define _Mlong_double_ long double
|
|
#endif
|
|
#define _Mdouble_ _Mlong_double_
|
|
#define __MATH_PRECNAME(name,r) name##l##r
|
|
#include <mathcalls.h>
|
|
#undef _Mdouble_
|
|
#undef __MATH_PRECNAME
|
|
|
|
#endif /* Use misc. */
|
|
|
|
|
|
#ifdef __USE_MISC
|
|
/* Support for various different standard error handling behaviors. */
|
|
|
|
typedef enum { _IEEE_ = -1, _SVID_, _XOPEN_, _POSIX_ } _LIB_VERSION_TYPE;
|
|
|
|
/* This variable can be changed at run-time to any of the values above to
|
|
affect floating point error handling behavior (it may also be necessary
|
|
to change the hardware FPU exception settings). */
|
|
extern _LIB_VERSION_TYPE _LIB_VERSION;
|
|
#endif
|
|
|
|
|
|
#ifdef __USE_SVID
|
|
/* In SVID error handling, `matherr' is called with this description
|
|
of the exceptional condition. */
|
|
struct exception
|
|
{
|
|
int type;
|
|
char *name;
|
|
double arg1;
|
|
double arg2;
|
|
double retval;
|
|
};
|
|
|
|
extern int __matherr __P ((struct exception *));
|
|
extern int matherr __P ((struct exception *));
|
|
|
|
#define X_TLOSS 1.41484755040568800000e+16
|
|
|
|
/* Types of exceptions in the `type' field. */
|
|
#define DOMAIN 1
|
|
#define SING 2
|
|
#define OVERFLOW 3
|
|
#define UNDERFLOW 4
|
|
#define TLOSS 5
|
|
#define PLOSS 6
|
|
|
|
/* SVID mode specifies returning this large value instead of infinity. */
|
|
#define HUGE FLT_MAX
|
|
#include <float.h> /* Defines FLT_MAX. */
|
|
|
|
#endif
|
|
|
|
|
|
#ifdef __USE_BSD
|
|
|
|
/* Some useful constants. */
|
|
#define M_E _Mldbl(2.7182818284590452354) /* e */
|
|
#define M_LOG2E _Mldbl(1.4426950408889634074) /* log 2e */
|
|
#define M_LOG10E _Mldbl(0.43429448190325182765) /* log 10e */
|
|
#define M_LN2 _Mldbl(0.69314718055994530942) /* log e2 */
|
|
#define M_LN10 _Mldbl(2.30258509299404568402) /* log e10 */
|
|
#define M_PI _Mldbl(3.14159265358979323846) /* pi */
|
|
#define M_PI_2 _Mldbl(1.57079632679489661923) /* pi/2 */
|
|
#define M_PI_4 _Mldbl(0.78539816339744830962) /* pi/4 */
|
|
#define M_1_PI _Mldbl(0.31830988618379067154) /* 1/pi */
|
|
#define M_2_PI _Mldbl(0.63661977236758134308) /* 2/pi */
|
|
#define M_2_SQRTPI _Mldbl(1.12837916709551257390) /* 2/sqrt(pi) */
|
|
#define M_SQRT2 _Mldbl(1.41421356237309504880) /* sqrt(2) */
|
|
#define M_SQRT1_2 _Mldbl(0.70710678118654752440) /* 1/sqrt(2) */
|
|
|
|
/* Our constants might specify more precision than `double' can represent.
|
|
Use `long double' constants in standard and GNU C, where they are
|
|
supported and the cast to `double'. */
|
|
#if __STDC__ - 0 || __GNUC__ - 0
|
|
#define _Mldbl(x) x##L
|
|
#else /* Traditional C. */
|
|
#define _Mldbl(x) x
|
|
#endif /* Standard or GNU C. */
|
|
|
|
#endif
|
|
|
|
|
|
/* Get machine-dependent inline versions (if there are any). */
|
|
#if defined (__NO_MATH_INLINES) || defined (__OPTIMIZE__)
|
|
#include <__math.h>
|
|
#endif
|
|
|
|
|
|
__END_DECLS
|
|
|
|
|
|
#endif /* math.h */
|