Commit Graph

23 Commits

Author SHA1 Message Date
mmacy
123afd0134 msun: add ld80/ld128 powl, cpow, cpowf, cpowl from openbsd
This corresponds to the latest status (hasn't changed in 9+
years) from openbsd of ld80/ld128 powl, and source cpowf, cpow,
cpowl (the complex power functions for float complex, double
complex, and long double complex) which are required for C99
compliance and were missing from FreeBSD. Also required for
some numerical codes using complex numbered Hamiltonians.

Thanks to jhb for tracking down the issue with making
weak_reference compile on powerpc.

When asked to review, bde said "I don't like it" - but
provided no actionable feedback or superior implementations.

Discussed with: jhb
Submitted by: jmd
Differential Revision: https://reviews.freebsd.org/D15919
2018-07-15 00:23:10 +00:00
kib
10f8899d3d Add implementations for clog(3), clogf(3), and clog(3).
PR:	216863
Submitted by:	bde, Steven G. Kargl <sgk@troutmask.apl.washington.edu>
MFC after:	2 weeks
2018-05-13 09:54:34 +00:00
pfg
d3308bc0e9 include: General further adoption of SPDX licensing ID tags.
Mainly focus on files that use BSD 2-Clause license, however the tool I
was using mis-identified many licenses so this was mostly a manual - error
prone - task.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.
2017-11-25 17:09:43 +00:00
mmokhi
5d369b0a15 Add new catrigl.c (r313761) APIs to include/complex.h
Reviewed by:	bde, emaste
Approved by:	bde, emaste (src committers)
Differential Revision:	https://reviews.freebsd.org/D9615
2017-02-18 21:08:09 +00:00
das
fd1293ba31 I'm happy to finally commit stephen@'s implementations of cacos,
cacosh, casin, casinh, catan, and catanh. Thanks to stephen@ and bde@
for working on these.

Submitted by:	stephen@
Reviewed by:	bde
2013-05-30 04:49:26 +00:00
ed
baa7787a16 Add C11 macros CMPLX(), CMPLXF() and CMPLXL().
Clang allows us to initialize complex numbers using an array
initializer, casted to a complex type. GCC has a builtin called
__builtin_complex().
2013-05-25 18:55:55 +00:00
ed
55f99993c3 Only use the static assertion when __generic is available.
Reported by:	tijl
2012-01-17 20:22:10 +00:00
ed
80cefe7b20 Remove redundant inclusion of <sys/cdefs.h>.
Mea culpa.
2012-01-05 12:09:39 +00:00
ed
7b66fc7484 Make _Complex_I a proper float _Complex when using GCC 4.2.
It turns out our GCC has quite an interesting bug:

	typeof(1.0fi) != float _Complex
	typeof((float _Complex)1.0fi) != float _Complex
	typeof((float _Complex)1.0i) == float _Complex

In other words: if casting to an equal size, GCC seems to take a
shortcut. By casting down from a double to a float, GCC doesn't take
this shortcut, yielding the proper type.

To prevent foot-shooting, add a _Static_assert() to guarantee that
_Complex_I is always a float _Complex. I'm not going to MFC this part of
the diff.

MFC after:	2 weeks
2012-01-05 12:05:48 +00:00
das
45d831bde4 Add c{cos,sin,tan}{,h}{,f} functions. This is joint work with
bde and kargl.
2011-10-17 05:41:03 +00:00
das
e3510dd429 Add missing declarations that I intended to commit with r219359.
Not sure why we have math.h in lib/msun/ and complex.h in include/.
2011-03-07 16:05:45 +00:00
das
ec47be13ee Implement cproj{,f,l}(). 2008-08-07 15:07:48 +00:00
das
30f45d2b49 Annotate creal(), cimag(), and conj() with __pure2. 2008-08-07 14:40:52 +00:00
das
7e1a7394d9 Implement csqrtl(). 2008-03-30 20:07:15 +00:00
das
4e563b6d98 Hook hypotl() and cabsl() up to the build. 2008-03-30 20:03:46 +00:00
das
28907d1d2e Implement and document csqrt(3) and csqrtf(3). 2007-12-15 08:38:44 +00:00
das
b9a043d44c Implement carg(3) and cargf(3).
Rotting in an old src tree since: March 2005
2007-12-12 23:43:51 +00:00
stefanf
04319f388a Stop defining '_Complex' in a C99 environment, it is supposed to be a keyword. 2004-08-14 18:03:21 +00:00
stefanf
0fd20b0ee2 Use tabulators after '#define'. 2004-08-14 17:55:15 +00:00
stefanf
46d384e689 Add implementations for cimag{,f,l}, creal{,f,l} and conj{,f,l}. They are
needed for cases where GCC's builtin functions cannot be used and for
compilers that don't know about them.

Approved by:	das (mentor)
2004-05-30 09:21:56 +00:00
stefanf
f495b1e357 Remove the macros for creal{,f} and cimag{,f}. They failed to convert their
arguments to the needed type and so the result type depended on the argument
type.  Fixing them isn't really worth the effort because GCC emits the same
assembler code with or without them.

Not minded by:	ru
Approved by:	das (mentor)
2004-05-30 08:47:12 +00:00
imp
300518c0a1 Breath deep and take __P out of the system include files.
# This appears to not break X11, but I'm having problems compiling the
# glide part of the server with or without this patch, so I can't tell
# for sure.
2002-03-23 17:24:55 +00:00
ru
0d5bbb0349 Added skeleton <complex.h> (aligned with the POSIX.1-200x), mostly
to fix the "-nostdinc WARNS=X" breakage caused by broken prototypes
for cabs() and cabsl() in <math.h>.

Reimplemented cabs() and cabsl() using new complex numbers types and
moved prototypes from <math.h> to <complex.h>.
2001-06-13 15:16:30 +00:00