Commit Graph

53 Commits

Author SHA1 Message Date
christos e2a86dd3c7 Commit SoC long double support from Stathis Kamperis 2010-09-15 16:11:28 +00:00
dholland f6e199ad65 typo in comment 2010-05-02 06:31:48 +00:00
joerg 839c0958b5 PR 36988: ISO C99 mandates that HUGE_VAL, HUGE_VALF, HUGE_VALL and
INFINITY are constant expressions.

Use the GCC builtins if possible to implement them.
2010-02-23 00:03:09 +00:00
christos 5f7c431ef4 Add exp2 and exp2m 2010-01-11 16:28:39 +00:00
christos 1799d3c97a oops forgot to commit that one--- Add f{dim,min,max}{,l,f} 2009-10-04 22:59:25 +00:00
martin c79c3eed1d Make NAN a compile time constant (with help from the compiler). Suggested
by krister. Fixes PR 40695.
Make references to the old construct (which we can't remove for binary
compatibility reasons) emit a linker warning.
2009-02-22 01:34:01 +00:00
christos bd1ba72f92 make name const. 2008-04-25 21:20:57 +00:00
drochner 7161d089aa -get cabs() and cabsf() out of public view - these are historical and
conflict with C99 functions which are builtins in newer gcc
 (actually, the old cabs() is ABI compatible with the new _complex one
  on i386, but this is purely accidental)
 remove public prototypes and manpages, move the code into a compat
 subdirectory as libc does so that binary compatibility is kept
-add a manpage for the isgreater() etc macros, borrowed from FreeBSD
2007-02-22 22:08:17 +00:00
drochner a981c4eb78 add the isgreater() at al. comparision macros defined in C99 and SUSv3;
use just the primitive macros for now (identical to FreeBSD/DragonFly)
which don't use gcc internals, the rest can go in after some testing;
addresses PR standards/25520
2007-02-06 17:29:37 +00:00
xtraeme f1336fbda3 Add trunc() and truncf() C99 functions, from FreeBSD. 2006-03-25 16:41:11 +00:00
kleink d66de2df34 Add nan(3), nanf(3), and nanl(3); welcome libm.so.0.4. 2006-03-23 16:55:42 +00:00
perry a2cd732268 Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete. 2005-12-24 19:12:23 +00:00
christos 1f35645781 Add log2f 2005-07-21 12:56:29 +00:00
perry 19b7469a00 de-__P -- the hack is long since useless. Discussed with christos,
matt, kleink, others. Approved by christos.
2005-02-03 04:39:32 +00:00
kleink 2284f27adc Move round() to the C99 section. 2004-07-12 23:44:52 +00:00
junyoung bc836a3102 lib/24252: Add C99 functions round(3) and roundf(3).
libm minor unchanged; ride a recent bump.

From FreeBSD.
2004-07-10 13:49:09 +00:00
drochner 147d852dbc being here, add the (l)lround(f) functions to libm
(almost the same like lrint)
2004-07-01 16:09:21 +00:00
drochner b6fcfe5309 shut up lint's "long long" warnings 2004-06-30 17:51:09 +00:00
drochner 737ab05bf9 Add (l)lrint(f).
Being here, move some C99 function declarations into the appropriate
section (as discussed with kleink).
2004-06-30 15:11:05 +00:00
kleink 8e54f10bf7 * Turn isinf(3) and isnan(3) into C99-style macros.
* Make it possible for ports to override these (i.e., VAX).
* Remove isnanl(), which was internal to libc only.
2004-03-04 23:42:38 +00:00
kleink 642c4f3f10 Make lint happy for __fpmacro_unary_floating() users. 2004-03-04 00:17:44 +00:00
kleink 15afe0b4fc Move FP_ROP and FP_DIRTYZERO from <math.h> to <vax/math.h> (where they
would have ended up if I hadn't missed the latter file in the commit).
2004-01-20 19:52:40 +00:00
matt 20fe2d9da9 Add FP_ROP and FP_DIRTYZERO to MD range for VAX. 2004-01-20 19:26:53 +00:00
uwe 11b19038f9 Close the comment after #endif. 2004-01-17 01:04:46 +00:00
kleink d82e732345 Add C99 fpclassify(), isfinite(), isnormal(), and signbit() macros. 2004-01-15 19:43:44 +00:00
kleink 793c50136c C99 7.12#4: provide INFINITY, which defaults to HUGE_VALF.
If infinities are not available, the machine-dependent header must define
__INFINITY as a positive constant of type float that overflows.
2003-10-26 00:02:02 +00:00
kleink adb0aada40 C99: provide HUGE_VALF and HUGE_VALL. 2003-10-25 22:35:46 +00:00
thorpej 200111747f Add long double support. 2003-05-17 20:42:28 +00:00
bjh21 4be7a2dcf3 Add a new feature-test macro, _NETBSD_SOURCE. If this is defined
by the application, all NetBSD interfaces are made visible, even
if some other feature-test macro (like _POSIX_C_SOURCE) is defined.
<sys/featuretest.h> defined _NETBSD_SOURCE if none of _ANSI_SOURCE,
_POSIX_C_SOURCE and _XOPEN_SOURCE is defined, so as to preserve
existing behaviour.

This has two major advantages:
+ Programs that require non-POSIX facilities but define _POSIX_C_SOURCE
  can trivially be overruled by putting -D_NETBSD_SOURCE in their CFLAGS.
+ It makes most of the #ifs simpler, in that they're all now ORs of the
  various macros, rather than having checks for (!defined(_ANSI_SOURCE) ||
  !defined(_POSIX_C_SOURCE) || !defined(_XOPEN_SOURCE)) all over the place.

I've tried not to change the semantics of the headers in any case where
_NETBSD_SOURCE wasn't defined, but there were some places where the
current semantics were clearly mad, and retaining them was harder than
correcting them.  In particular, I've mostly normalised things so that
_ANSI_SOURCE gets you the smallest set of stuff, then _POSIX_C_SOURCE,
_XOPEN_SOURCE and _NETBSD_SOURCE in that order.

Tested by building for vax, encouraged by thorpej, and uncontested in
tech-userlevel for a week.
2003-04-28 23:16:11 +00:00
simonb 2d8577fb83 Clean up some rampant code duplication wrt ieee number handling:
- Add alignment-safe double and float unions.
 - Use the above for the __infinity and __nan constants on all
   architectures that use the standard ieee754 representation of
   those constants.
 - Add a single copy of various ieee754 math functions (frexp, isinf,
   isnan, ldexp and modf) that had numerous duplicates among the
   arch-specific directories.
 - Use the above functions on all architectures where the generic C
   versions where used.  Architectures that had local assembly
   routines are untouched (for those functions only).
2002-02-19 13:08:12 +00:00
christos eedd4b5634 protect the incomplete cabs declarations with #ifndef __MATH_PRIVATE__ so that
the code that defines the functions can declare them properly.
2001-01-05 23:36:38 +00:00
simonb 3f935d014c Remove 'extern' from function declarations. 2000-06-13 01:21:52 +00:00
kleink 693059feda const -> __const and include <sys/cdefs.h> earlier; fixes PR lib/9052
by Takahiro Kambe.
2000-01-04 14:20:05 +00:00
kleink 11e6c54cfc C99: Define a NAN macro in <math.h> which evaulates to a constant expression of
a single-precision quiet NaN; only to be defined on platforms that do support
this value.
1999-12-23 10:15:05 +00:00
kleink 2977ab90fe Add missing isinff() declaration. 1999-08-16 18:57:57 +00:00
christos a776f4ee44 This file has still missing prototypes: cabs and cabsf... At least comment
what the arguments should be.
1999-01-31 19:32:26 +00:00
christos e6bf91675e s/void/const void/ 1998-11-15 16:51:45 +00:00
christos 186efef26d cast to void * first to avoid lint warning. 1998-11-15 15:57:25 +00:00
kleink 02a4a2105b Oops, isinf() was never included in any X/Open interface specification. 1998-09-07 15:00:05 +00:00
mycroft 982e920022 const poisoning. 1998-07-26 14:13:00 +00:00
kleink fbfd5f44f3 Fix comment typo in previous. 1998-05-11 11:06:23 +00:00
kleink ac3781ec96 Reorganize name space protection. 1998-05-07 18:50:08 +00:00
tv 12c753dbfe C++ has a very different concept of "exception." Delimit struct exception
and matherr() with #ifndef __cplusplus.
1998-04-08 23:42:59 +00:00
cgd 4d2cbfce0a new RCS ID format. 1994-10-26 00:55:40 +00:00
jtc b6e27e8793 Added prototypes for float versions of math functions.
Removed prototypes for internal functions.
1994-08-10 20:48:16 +00:00
jtc 29576d7ee9 Add cabs() and drem(), for BSD libm compatibility. 1994-03-01 17:16:19 +00:00
cgd 358113c8d4 Add missing _. reported by several folks. 1994-02-14 02:11:39 +00:00
jtc f3a958ae63 New math.h, based on fdlibm's fdlibm.h. 1994-02-11 18:36:42 +00:00
jtc 3088508ccf Moved definition of M_FOO constants into !_ANSI_SOURCE && !_POSIX_SOURCE
conditional.
1993-10-11 18:13:24 +00:00
jtc 91d4aa53f0 Use __pure qualifier. 1993-08-04 17:24:44 +00:00