OpenBSD CVS

CVS log for src/include/math.h


[BACK] Up to [local] / src / include

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.36 / (download) - annotate - [select for diffs], Sat Mar 10 20:52:58 2018 UTC (6 years, 2 months ago) by kettenis
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2, OPENBSD_7_1_BASE, OPENBSD_7_1, OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9, OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7, OPENBSD_6_6_BASE, OPENBSD_6_6, OPENBSD_6_5_BASE, OPENBSD_6_5, OPENBSD_6_4_BASE, OPENBSD_6_4, OPENBSD_6_3_BASE, OPENBSD_6_3, HEAD
Changes since 1.35: +12 -1 lines
Diff to previous 1.35 (colored)

Implement sicos(3), sincosf(3) and sincosl(3).  These functions are common
extensions and modern compilers (such as clang) will use them to optimize
separate calculations of sine and cosine.

ok tom@, patrick@, deraadt@, jmc@

Revision 1.35 / (download) - annotate - [select for diffs], Thu Mar 17 20:55:35 2016 UTC (8 years, 2 months ago) by jca
Branch: MAIN
CVS Tags: OPENBSD_6_2_BASE, OPENBSD_6_2, OPENBSD_6_1_BASE, OPENBSD_6_1, OPENBSD_6_0_BASE, OPENBSD_6_0
Changes since 1.34: +7 -22 lines
Diff to previous 1.34 (colored)

Remove #ifdef __vax__ bits

ok deraadt@ tb@ (who had the same diff)

Revision 1.34 / (download) - annotate - [select for diffs], Sun Jul 19 17:41:49 2015 UTC (8 years, 10 months ago) by martynas
Branch: MAIN
CVS Tags: OPENBSD_5_9_BASE, OPENBSD_5_9, OPENBSD_5_8_BASE, OPENBSD_5_8
Changes since 1.33: +17 -1 lines
Diff to previous 1.33 (colored)

Define new C99 macros:
- MATH_ERRNO, MATH_ERREXCEPTION and math_errhandling
- Optional FP_FAST_FMA{,F,L} macros if fma() executes as fast or faster
than (x * y) + z;  which in practice is achievable if gcc implements
__FP_FAST_FMA{,F,L}
Reported by John Marino @ DragonFlyBSD.

Revision 1.33 / (download) - annotate - [select for diffs], Sat May 3 16:13:03 2014 UTC (10 years ago) by martynas
Branch: MAIN
CVS Tags: OPENBSD_5_7_BASE, OPENBSD_5_7, OPENBSD_5_6_BASE, OPENBSD_5_6
Changes since 1.32: +30 -14 lines
Diff to previous 1.32 (colored)

- Provide extended-precision math constants req'd by POSIX
- Explicitly cast double-precision constants as needed for
FLT_EVAL_METHOD = 2 archs
OK guenther@, ratchov@

Revision 1.32 / (download) - annotate - [select for diffs], Tue Aug 6 19:04:50 2013 UTC (10 years, 9 months ago) by miod
Branch: MAIN
CVS Tags: OPENBSD_5_5_BASE, OPENBSD_5_5
Changes since 1.31: +7 -7 lines
Diff to previous 1.31 (colored)

Try and avoid using __builtin_huge_val*() and __builtin_{inf,nan}* on vax
running gcc 3, for gcc will output a reserved operand for these.

ok martynas@ matthew@ espie@ guenther@

Revision 1.31 / (download) - annotate - [select for diffs], Wed Dec 5 23:19:57 2012 UTC (11 years, 5 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_4_BASE, OPENBSD_5_4, OPENBSD_5_3_BASE, OPENBSD_5_3
Changes since 1.30: +1 -2 lines
Diff to previous 1.30 (colored)

Remove excessive sys/cdefs.h inclusion
ok guenther millert kettenis

Revision 1.30 / (download) - annotate - [select for diffs], Wed Jul 6 00:02:42 2011 UTC (12 years, 10 months ago) by martynas
Branch: MAIN
CVS Tags: OPENBSD_5_2_BASE, OPENBSD_5_2, OPENBSD_5_1_BASE, OPENBSD_5_1, OPENBSD_5_0_BASE, OPENBSD_5_0
Changes since 1.29: +1 -35 lines
Diff to previous 1.29 (colored)

Finalize work on the math library.  It's time to do this monster
commit, and deal with problems (if any) in tree.

Note that this adds the following functions.  Ports with hacks might
need adjustments.

nexttoward(3), fma(3), nexttowardf(3), fmaf(3), acoshl(3), asinhl(3),
atanhl(3), coshl(3), sinhl(3), tanhl(3), expl(3), expm1l(3), logl(3),
log10l(3), log1pl(3), log2l(3), modfl(3), cbrtl(3), hypotl(3),
powl(3), erfl(3), erfcl(3), lgammal(3), tgammal(3), ceill(3),
floorl(3), lrintl(3), llrintl(3), roundl(3), lroundl(3), llroundl(3),
truncl(3), fmodl(3), remainderl(3), remquol(3), nextafterl(3),
nexttowardl(3), fmal(3).

With this commit, our library implements all functionality required
by C99.  Documentation bits will follow.

Revision 1.29 / (download) - annotate - [select for diffs], Wed May 25 21:46:49 2011 UTC (12 years, 11 months ago) by martynas
Branch: MAIN
Changes since 1.28: +2 -2 lines
Diff to previous 1.28 (colored)

Also enclose variable names with external linkage in __BEGIN_DECLS.

Doesn't matter much since C++ ABI used by GCC doesn't mangle variable
names;  however technically is required by Section 7.5 of the C++ spec.

Discussed with/OK guenther@, matthew@.

Revision 1.28 / (download) - annotate - [select for diffs], Thu Apr 28 18:05:39 2011 UTC (13 years ago) by martynas
Branch: MAIN
Changes since 1.27: +2 -6 lines
Diff to previous 1.27 (colored)

- enable fenv
- add nearbyint, nearbyintf and nearbyintl implemented using fenv

Revision 1.27 / (download) - annotate - [select for diffs], Tue Dec 14 11:16:15 2010 UTC (13 years, 5 months ago) by martynas
Branch: MAIN
CVS Tags: OPENBSD_4_9_BASE, OPENBSD_4_9
Changes since 1.26: +12 -1 lines
Diff to previous 1.26 (colored)

- make HUGE_VAL, HUGE_VALF, HUGE_VALL, INFINITY, NAN expand to the
constant expressions with the help of gcc post-3.3.
ok millert@, mikeb@.  been in snaps for weeks.

Revision 1.26 / (download) - annotate - [select for diffs], Sat Jul 25 11:38:09 2009 UTC (14 years, 9 months ago) by martynas
Branch: MAIN
CVS Tags: OPENBSD_4_8_BASE, OPENBSD_4_8, OPENBSD_4_7_BASE, OPENBSD_4_7
Changes since 1.25: +1 -7 lines
Diff to previous 1.25 (colored)

int is big enough to fully represent exponents of all supported fp
formats.  which even for 80-bit & 128-bit long doubles is only 15
bits.  therefore, scalbln, scalblnf, scalblnl are essentially the
same as scalbn, scalbnf, scalbnl with bounds checking so that
LONG_MIN..INT_MIN, and INT_MAX..LONG_MAX ranges properly raise
exceptions & yield correct values.  looks good to millert@

Revision 1.25 / (download) - annotate - [select for diffs], Wed Apr 8 23:09:50 2009 UTC (15 years, 1 month ago) by martynas
Branch: MAIN
CVS Tags: OPENBSD_4_6_BASE, OPENBSD_4_6
Changes since 1.24: +237 -237 lines
Diff to previous 1.24 (colored)

nuke extern from func decls.  ok millert@

Revision 1.24 / (download) - annotate - [select for diffs], Thu Dec 11 12:08:27 2008 UTC (15 years, 5 months ago) by martynas
Branch: MAIN
CVS Tags: OPENBSD_4_5_BASE, OPENBSD_4_5
Changes since 1.23: +2 -1 lines
Diff to previous 1.23 (colored)

add __infinityf declaration.  (only affects vax).  pointed out by miod@

Revision 1.23 / (download) - annotate - [select for diffs], Tue Dec 9 20:02:02 2008 UTC (15 years, 5 months ago) by martynas
Branch: MAIN
Changes since 1.22: +36 -4 lines
Diff to previous 1.22 (colored)

expose extended-precision definitions.     ok millert@

Revision 1.22 / (download) - annotate - [select for diffs], Tue Sep 9 20:42:55 2008 UTC (15 years, 8 months ago) by martynas
Branch: MAIN
Changes since 1.21: +1 -3 lines
Diff to previous 1.21 (colored)

sigh, gamma got lost

Revision 1.21 / (download) - annotate - [select for diffs], Sun Sep 7 20:36:07 2008 UTC (15 years, 8 months ago) by martynas
Branch: MAIN
Changes since 1.20: +14 -67 lines
Diff to previous 1.20 (colored)

- replace dtoa w/ David's gdtoa, version 2008-03-15
- provide proper dtoa locks
- use the real strtof implementation
- add strtold, __hdtoa, __hldtoa
- add %a/%A support
- don't lose precision in printf, don't round to double anymore
- implement extended-precision versions of libc functions: fpclassify,
isnan, isinf, signbit, isnormal, isfinite, now that the ieee.h is
fixed
- separate vax versions of strtof, and __hdtoa
- add complex math support.  added functions: cacos, casin, catan,
ccos, csin, ctan, cacosh, casinh, catanh, ccosh, csinh, ctanh, cexp,
clog, cabs, cpow, csqrt, carg, cimag, conj, cproj, creal, cacosf,
casinf, catanf, ccosf, csinf, ctanf, cacoshf, casinhf, catanhf,
ccoshf, csinhf, ctanhf, cexpf, clogf, cabsf, cpowf, csqrtf, cargf,
cimagf, conjf, cprojf, crealf
- add fdim, fmax, fmin
- add log2. (adapted implementation e_log.c.  could be more acruate
& faster, but it's good enough for now)
- remove wrappers & cruft in libm, supposed to work-around mistakes
in SVID, etc.;  use ieee versions.  fixes issues in python 2.6 for
djm@
- make _digittoint static
- proper definitions for i386, and amd64 in ieee.h
- sh, powerpc don't really have extended-precision
- add missing definitions for mips64 (quad), m{6,8}k (96-bit) float.h
for LDBL_*
- merge lead to frac for m{6,8}k, for gdtoa to work properly
- add FRAC*BITS & EXT_TO_ARRAY32 definitions in ieee.h, for hdtoa&ldtoa
to use
- add EXT_IMPLICIT_NBIT definition, which indicates implicit
normalization bit
- add regression tests for libc: fpclassify and printf
- arith.h & gd_qnan.h definitions
- update ieee.h: hppa doesn't have quad-precision, hppa64 does
- add missing prototypes to gdtoaimp
- on 64-bit platforms make sure gdtoa doesn't use a long when it
really wants an int
- etc., what i may have forgotten...
- bump libm major, due to removed&changed symbols
- no libc bump, since this is riding on djm's libc major crank from
a day ago

discussed with / requested by / testing theo, sthen@, djm@, jsg@,
merdely@, jsing@, tedu@, brad@, jakemsr@, and others.
looks good to millert@
parts of the diff ok kettenis@

this commit does not include:
- man page changes

Revision 1.20 / (download) - annotate - [select for diffs], Thu Jul 24 09:41:58 2008 UTC (15 years, 9 months ago) by martynas
Branch: MAIN
CVS Tags: OPENBSD_4_4_BASE, OPENBSD_4_4
Changes since 1.19: +1 -13 lines
Diff to previous 1.19 (colored)

unXXX prototypes: exp2, remquo, nan, exp2f, remquof, nanf

Revision 1.19 / (download) - annotate - [select for diffs], Thu Jul 24 09:35:30 2008 UTC (15 years, 9 months ago) by martynas
Branch: MAIN
Changes since 1.18: +5 -11 lines
Diff to previous 1.18 (colored)

- add NAN definition (except on VAX)
- add C99 real-floating macros fpclassify isfinite isinf isnan
isnormal signbit
- add C99 macros isgreater isgreaterequal isless islessequal
islessgreater isunordered
- add function prototypes, __fpclassify __fpclassifyf __fpclassifyl
__isfinite __isfinitef __isfinitel __isinf __isinfl __isnan __isnanl
__isnormal __isnormalf __isnormall __signbit __signbitf __signbitl
ok millert@

Revision 1.18 / (download) - annotate - [select for diffs], Tue Jul 22 16:01:46 2008 UTC (15 years, 9 months ago) by martynas
Branch: MAIN
Changes since 1.17: +343 -111 lines
Diff to previous 1.17 (colored)

- added HUGE_VALF, HUGE_VALL, INFINITY, FP_INFINITE, FP_NAN,
FP_NORMAL, FP_SUBNORMAL, FP_ZERO, FP_ILOGB0, FP_ILOGBNAN definitions,
per C99
- classify functions into sections, add missing definitions, add
and some '#if 0' functions, and long double definitions, so we see
what's needed to be done
- other stuff is XXX'd, and will be uncommented soon
ok millert@

Revision 1.17 / (download) - annotate - [select for diffs], Mon Jul 21 20:50:54 2008 UTC (15 years, 10 months ago) by martynas
Branch: MAIN
Changes since 1.16: +4 -6 lines
Diff to previous 1.16 (colored)

- add proper double_t and float_t definitions for each arch
- math.h shouldn't define FLT_EVAL_METHOD, but float.h should (per
C99).  remove from math.h, and add proper definitions in float.h
ok millert@

Revision 1.16 / (download) - annotate - [select for diffs], Wed Jul 16 15:01:19 2008 UTC (15 years, 10 months ago) by martynas
Branch: MAIN
Changes since 1.15: +5 -1 lines
Diff to previous 1.15 (colored)

infnan always returned wrong values, because compiler assumed it
returns integer value, so add missing prototype
ok millert@

Revision 1.15 / (download) - annotate - [select for diffs], Wed Jun 11 21:16:43 2008 UTC (15 years, 11 months ago) by martynas
Branch: MAIN
Changes since 1.14: +3 -1 lines
Diff to previous 1.14 (colored)

tgamma and tgammaf

Revision 1.14 / (download) - annotate - [select for diffs], Wed Jul 12 07:26:07 2006 UTC (17 years, 10 months ago) by brad
Branch: MAIN
CVS Tags: OPENBSD_4_3_BASE, OPENBSD_4_3, OPENBSD_4_2_BASE, OPENBSD_4_2, OPENBSD_4_1_BASE, OPENBSD_4_1, OPENBSD_4_0_BASE, OPENBSD_4_0
Changes since 1.13: +3 -1 lines
Diff to previous 1.13 (colored)

add some more C99 functions: round(3) and roundf(3).

By Steven G. Kargl <kargl at troutmask dot apl dot washington.edu>
From FreeBSD

Revision 1.13 / (download) - annotate - [select for diffs], Wed Jul 12 06:43:31 2006 UTC (17 years, 10 months ago) by brad
Branch: MAIN
Changes since 1.12: +5 -1 lines
Diff to previous 1.12 (colored)

add missing prototypes for trunc/truncf.

Revision 1.12 / (download) - annotate - [select for diffs], Fri May 5 20:10:25 2006 UTC (18 years ago) by otto
Branch: MAIN
Changes since 1.11: +2 -2 lines
Diff to previous 1.11 (colored)

delint; ok millert@ beck@

Revision 1.11 / (download) - annotate - [select for diffs], Tue Dec 13 00:35:22 2005 UTC (18 years, 5 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_3_9_BASE, OPENBSD_3_9
Changes since 1.10: +15 -15 lines
Diff to previous 1.10 (colored)

First step in include files overhaul.  Use __FOO_VISIBLE (as defined
in sys/cdefs.h) instead of _FOO_SOURCE.  Also fix several namespace
pollution issues, including the byte order defines.  OK deraadt@

Revision 1.10 / (download) - annotate - [select for diffs], Thu Nov 17 20:07:40 2005 UTC (18 years, 6 months ago) by otto
Branch: MAIN
Changes since 1.9: +9 -1 lines
Diff to previous 1.9 (colored)

Introduce a few c99 functions: {l,ll}{rint,round}{,f}. From NetBSD via
jason@. Man page fixes by jmc@, prodding by jsg@. ok mickey@

Revision 1.9 / (download) - annotate - [select for diffs], Thu Jan 6 20:36:23 2005 UTC (19 years, 4 months ago) by espie
Branch: MAIN
CVS Tags: OPENBSD_3_8_BASE, OPENBSD_3_8, OPENBSD_3_7_BASE, OPENBSD_3_7
Changes since 1.8: +11 -1 lines
Diff to previous 1.8 (colored)

provide float_t, double_t, FLT_EVAL_METHOD (dummy C99 constructs)

okay millert@

Revision 1.8 / (download) - annotate - [select for diffs], Thu Jun 26 22:40:27 2003 UTC (20 years, 10 months ago) by jason
Branch: MAIN
CVS Tags: OPENBSD_3_6_BASE, OPENBSD_3_6, OPENBSD_3_5_BASE, OPENBSD_3_5, OPENBSD_3_4_BASE, OPENBSD_3_4
Changes since 1.7: +2 -2 lines
Diff to previous 1.7 (colored)

Better value for vax MAXFLOAT

Revision 1.7 / (download) - annotate - [select for diffs], Thu Jun 26 22:27:14 2003 UTC (20 years, 10 months ago) by jason
Branch: MAIN
Changes since 1.6: +6 -1 lines
Diff to previous 1.6 (colored)

redefine MAXFLOAT in vax terms

Revision 1.6 / (download) - annotate - [select for diffs], Sat Feb 16 21:27:17 2002 UTC (22 years, 3 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_3_3_BASE, OPENBSD_3_3, OPENBSD_3_2_BASE, OPENBSD_3_2, OPENBSD_3_1_BASE, OPENBSD_3_1
Changes since 1.5: +120 -120 lines
Diff to previous 1.5 (colored)

Part one of userland __P removal.  Done with a simple regexp with some minor hand editing to make comments line up correctly.  Another pass is forthcoming that handles the cases that could not be done automatically.

Revision 1.5 / (download) - annotate - [select for diffs], Sat May 26 01:49:25 2001 UTC (22 years, 11 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_3_0_BASE, OPENBSD_3_0
Changes since 1.4: +2 -2 lines
Diff to previous 1.4 (colored)

Change protection of struct exception back from #ifdef __LIBM_PRIVATE
to #ifndef __cplusplus.  It turns out there is code outside of libm
that wants to use this.  I suppose that's why it is in math.h instead
of math_private.h ;-)

Revision 1.4 / (download) - annotate - [select for diffs], Wed Mar 1 22:27:13 2000 UTC (24 years, 2 months ago) by todd
Branch: MAIN
CVS Tags: OPENBSD_2_9_BASE, OPENBSD_2_9, OPENBSD_2_8_BASE, OPENBSD_2_8, OPENBSD_2_7_BASE, OPENBSD_2_7
Changes since 1.3: +1 -1 lines
Diff to previous 1.3 (colored)

$OpenBSD$

Revision 1.3 / (download) - annotate - [select for diffs], Mon Mar 2 23:58:02 1998 UTC (26 years, 2 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_2_6_BASE, OPENBSD_2_6, OPENBSD_2_5_BASE, OPENBSD_2_5, OPENBSD_2_4_BASE, OPENBSD_2_4, OPENBSD_2_3_BASE, OPENBSD_2_3
Changes since 1.2: +7 -4 lines
Diff to previous 1.2 (colored)

We don't need two math.h headers incvs server: nothing known about
`math.h'.  The one in libm is more up to date but the one in the
include dir is what gets installed.

Revision 1.2 / (download) - annotate - [select for diffs], Sun Sep 21 10:45:42 1997 UTC (26 years, 8 months ago) by niklas
Branch: MAIN
CVS Tags: OPENBSD_2_2_BASE, OPENBSD_2_2
Changes since 1.1: +1 -0 lines
Diff to previous 1.1 (colored)

Well, as we are heading for a release people are encouraged to rebuild their
entire trees for testing anyway, I might as well do this intrusive touching
of include files now.  Added openBSD tags.

Revision 1.1.1.1 / (download) - annotate - [select for diffs] (vendor branch), Wed Oct 18 08:41:13 1995 UTC (28 years, 7 months ago) by deraadt
CVS Tags: netbsd_1_1, OPENBSD_2_1_BASE, OPENBSD_2_1, OPENBSD_2_0_BASE, OPENBSD_2_0
Changes since 1.1: +0 -0 lines
Diff to previous 1.1 (colored)

initial import of NetBSD tree

Revision 1.1 / (download) - annotate - [select for diffs], Wed Oct 18 08:41:13 1995 UTC (28 years, 7 months ago) by deraadt
Branch: MAIN

Initial revision

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.