2014-11-06 20:16:55 +01:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2014 The Android Open Source Project
|
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <gtest/gtest.h>
|
|
|
|
|
2017-09-15 00:30:08 +02:00
|
|
|
#if defined(__BIONIC_LP32_USE_LONG_DOUBLE)
|
|
|
|
#define COMPLEX_TEST complex_h_force_long_double
|
|
|
|
#else
|
|
|
|
#define COMPLEX_TEST complex_h
|
|
|
|
#endif
|
|
|
|
|
2016-04-29 20:52:39 +02:00
|
|
|
// This file is compiled against both glibc and bionic, and our complex.h
|
|
|
|
// depends on bionic-specific macros, so hack around that.
|
|
|
|
#include <sys/cdefs.h>
|
|
|
|
#if !defined(__INTRODUCED_IN)
|
|
|
|
#define __INTRODUCED_IN(x)
|
2016-04-29 21:15:18 +02:00
|
|
|
#define __INTRODUCED_IN_32(x)
|
|
|
|
#define __INTRODUCED_IN_64(x)
|
2016-04-29 22:45:25 +02:00
|
|
|
#define __INTRODUCED_IN_FUTURE
|
2017-09-15 00:30:08 +02:00
|
|
|
#define __RENAME_LDBL(a,b,c)
|
2016-04-29 20:52:39 +02:00
|
|
|
#endif
|
|
|
|
|
2014-11-06 20:16:55 +01:00
|
|
|
// libc++ actively gets in the way of including <complex.h> from C++, so we
|
Add missing <complex.h> functions.
FreeBSD doesn't seem interested in having low-quality implementations of
these functions:
cacoshl, cacosl, casinhl, casinl, catanhl, catanl, ccoshl, ccosl, cexpl,
clog, clogf, clogl, cpow, cpowf, cpowl, csinhl, csinl, ctanhl, ctanl.
And they still haven't got round to writing good implementations, so for
now let's just take the NetBSD ones so we have the full set.
Bug: http://b/27555792
Change-Id: I6b72003cf749b1043f006377a01fffe5e1d659bc
2016-03-11 23:49:13 +01:00
|
|
|
// have to be naughty.
|
2017-08-05 00:37:39 +02:00
|
|
|
#include "../libc/include/complex.h"
|
Add missing <complex.h> functions.
FreeBSD doesn't seem interested in having low-quality implementations of
these functions:
cacoshl, cacosl, casinhl, casinl, catanhl, catanl, ccoshl, ccosl, cexpl,
clog, clogf, clogl, cpow, cpowf, cpowl, csinhl, csinl, ctanhl, ctanl.
And they still haven't got round to writing good implementations, so for
now let's just take the NetBSD ones so we have the full set.
Bug: http://b/27555792
Change-Id: I6b72003cf749b1043f006377a01fffe5e1d659bc
2016-03-11 23:49:13 +01:00
|
|
|
|
2014-11-06 20:16:55 +01:00
|
|
|
// (libc++ also seems to have really bad implementations of its own that ignore
|
|
|
|
// the intricacies of floating point math.)
|
|
|
|
// http://llvm.org/bugs/show_bug.cgi?id=21504
|
|
|
|
|
Add missing <complex.h> functions.
FreeBSD doesn't seem interested in having low-quality implementations of
these functions:
cacoshl, cacosl, casinhl, casinl, catanhl, catanl, ccoshl, ccosl, cexpl,
clog, clogf, clogl, cpow, cpowf, cpowl, csinhl, csinl, ctanhl, ctanl.
And they still haven't got round to writing good implementations, so for
now let's just take the NetBSD ones so we have the full set.
Bug: http://b/27555792
Change-Id: I6b72003cf749b1043f006377a01fffe5e1d659bc
2016-03-11 23:49:13 +01:00
|
|
|
#include <math.h> // For M_PI_2/M_PI_2l.
|
|
|
|
|
2017-09-15 00:30:08 +02:00
|
|
|
#if 0
|
Add missing <complex.h> functions.
FreeBSD doesn't seem interested in having low-quality implementations of
these functions:
cacoshl, cacosl, casinhl, casinl, catanhl, catanl, ccoshl, ccosl, cexpl,
clog, clogf, clogl, cpow, cpowf, cpowl, csinhl, csinl, ctanhl, ctanl.
And they still haven't got round to writing good implementations, so for
now let's just take the NetBSD ones so we have the full set.
Bug: http://b/27555792
Change-Id: I6b72003cf749b1043f006377a01fffe5e1d659bc
2016-03-11 23:49:13 +01:00
|
|
|
// Note that gtest doesn't support complex numbers, so the output from
|
|
|
|
// assertion failures is misleading/useless (at best you'll only see the real
|
|
|
|
// part).
|
|
|
|
// TODO: find out why gtest doesn't use these; until then they're only useful
|
|
|
|
// for manual printf^Woperator<< debugging.
|
|
|
|
#include <iostream>
|
|
|
|
std::ostream& operator<<(std::ostream& os, const double _Complex c) {
|
|
|
|
os << "(" << creal(c) << "," << cimag(c) << "i)";
|
|
|
|
return os;
|
|
|
|
}
|
|
|
|
std::ostream& operator<<(std::ostream& os, const float _Complex c) {
|
|
|
|
os << "(" << crealf(c) << "," << cimagf(c) << "i)";
|
|
|
|
return os;
|
|
|
|
}
|
|
|
|
std::ostream& operator<<(std::ostream& os, const long double _Complex c) {
|
|
|
|
os << "(" << creall(c) << "," << cimagl(c) << "i)";
|
|
|
|
return os;
|
|
|
|
}
|
2017-09-15 00:30:08 +02:00
|
|
|
#endif
|
2014-11-06 20:16:55 +01:00
|
|
|
|
2017-09-15 00:30:08 +02:00
|
|
|
TEST(COMPLEX_TEST, cabs) {
|
2014-11-06 20:16:55 +01:00
|
|
|
ASSERT_EQ(0.0, cabs(0));
|
|
|
|
}
|
|
|
|
|
2017-09-15 00:30:08 +02:00
|
|
|
TEST(COMPLEX_TEST, cabsf) {
|
2014-11-06 20:16:55 +01:00
|
|
|
ASSERT_EQ(0.0, cabsf(0));
|
|
|
|
}
|
|
|
|
|
2017-09-15 00:30:08 +02:00
|
|
|
TEST(COMPLEX_TEST, cabsl) {
|
2014-11-06 20:16:55 +01:00
|
|
|
ASSERT_EQ(0.0, cabsl(0));
|
|
|
|
}
|
|
|
|
|
2017-09-15 00:30:08 +02:00
|
|
|
TEST(COMPLEX_TEST, cacos) {
|
Add missing <complex.h> functions.
FreeBSD doesn't seem interested in having low-quality implementations of
these functions:
cacoshl, cacosl, casinhl, casinl, catanhl, catanl, ccoshl, ccosl, cexpl,
clog, clogf, clogl, cpow, cpowf, cpowl, csinhl, csinl, ctanhl, ctanl.
And they still haven't got round to writing good implementations, so for
now let's just take the NetBSD ones so we have the full set.
Bug: http://b/27555792
Change-Id: I6b72003cf749b1043f006377a01fffe5e1d659bc
2016-03-11 23:49:13 +01:00
|
|
|
ASSERT_EQ(M_PI_2, cacos(0.0));
|
2014-11-06 20:16:55 +01:00
|
|
|
}
|
|
|
|
|
2017-09-15 00:30:08 +02:00
|
|
|
TEST(COMPLEX_TEST, cacosf) {
|
Add missing <complex.h> functions.
FreeBSD doesn't seem interested in having low-quality implementations of
these functions:
cacoshl, cacosl, casinhl, casinl, catanhl, catanl, ccoshl, ccosl, cexpl,
clog, clogf, clogl, cpow, cpowf, cpowl, csinhl, csinl, ctanhl, ctanl.
And they still haven't got round to writing good implementations, so for
now let's just take the NetBSD ones so we have the full set.
Bug: http://b/27555792
Change-Id: I6b72003cf749b1043f006377a01fffe5e1d659bc
2016-03-11 23:49:13 +01:00
|
|
|
ASSERT_EQ(static_cast<float>(M_PI_2), cacosf(0.0));
|
|
|
|
}
|
|
|
|
|
2017-09-15 00:30:08 +02:00
|
|
|
TEST(COMPLEX_TEST, cacosl) {
|
Add missing <complex.h> functions.
FreeBSD doesn't seem interested in having low-quality implementations of
these functions:
cacoshl, cacosl, casinhl, casinl, catanhl, catanl, ccoshl, ccosl, cexpl,
clog, clogf, clogl, cpow, cpowf, cpowl, csinhl, csinl, ctanhl, ctanl.
And they still haven't got round to writing good implementations, so for
now let's just take the NetBSD ones so we have the full set.
Bug: http://b/27555792
Change-Id: I6b72003cf749b1043f006377a01fffe5e1d659bc
2016-03-11 23:49:13 +01:00
|
|
|
ASSERT_EQ(M_PI_2l, cacosl(0.0));
|
2014-11-06 20:16:55 +01:00
|
|
|
}
|
|
|
|
|
2017-09-15 00:30:08 +02:00
|
|
|
TEST(COMPLEX_TEST, cacosh) {
|
2014-11-06 20:16:55 +01:00
|
|
|
ASSERT_EQ(0.0, cacosh(1.0));
|
|
|
|
}
|
|
|
|
|
2017-09-15 00:30:08 +02:00
|
|
|
TEST(COMPLEX_TEST, cacoshl) {
|
Add missing <complex.h> functions.
FreeBSD doesn't seem interested in having low-quality implementations of
these functions:
cacoshl, cacosl, casinhl, casinl, catanhl, catanl, ccoshl, ccosl, cexpl,
clog, clogf, clogl, cpow, cpowf, cpowl, csinhl, csinl, ctanhl, ctanl.
And they still haven't got round to writing good implementations, so for
now let's just take the NetBSD ones so we have the full set.
Bug: http://b/27555792
Change-Id: I6b72003cf749b1043f006377a01fffe5e1d659bc
2016-03-11 23:49:13 +01:00
|
|
|
ASSERT_EQ(0.0, cacoshl(1.0));
|
|
|
|
}
|
|
|
|
|
2017-09-15 00:30:08 +02:00
|
|
|
TEST(COMPLEX_TEST, cacoshf) {
|
2014-11-06 20:16:55 +01:00
|
|
|
ASSERT_EQ(0.0, cacoshf(1.0));
|
|
|
|
}
|
|
|
|
|
2017-09-15 00:30:08 +02:00
|
|
|
TEST(COMPLEX_TEST, carg) {
|
2014-11-06 20:16:55 +01:00
|
|
|
ASSERT_EQ(0.0, carg(0));
|
|
|
|
}
|
|
|
|
|
2017-09-15 00:30:08 +02:00
|
|
|
TEST(COMPLEX_TEST, cargf) {
|
2014-11-06 20:16:55 +01:00
|
|
|
ASSERT_EQ(0.0, cargf(0));
|
|
|
|
}
|
|
|
|
|
2017-09-15 00:30:08 +02:00
|
|
|
TEST(COMPLEX_TEST, cargl) {
|
2014-11-06 20:16:55 +01:00
|
|
|
ASSERT_EQ(0.0, cargl(0));
|
|
|
|
}
|
|
|
|
|
2017-09-15 00:30:08 +02:00
|
|
|
TEST(COMPLEX_TEST, casin) {
|
2014-11-06 20:16:55 +01:00
|
|
|
ASSERT_EQ(0.0, casin(0));
|
|
|
|
}
|
|
|
|
|
2017-09-15 00:30:08 +02:00
|
|
|
TEST(COMPLEX_TEST, casinf) {
|
2014-11-06 20:16:55 +01:00
|
|
|
ASSERT_EQ(0.0, casinf(0));
|
|
|
|
}
|
|
|
|
|
2017-09-15 00:30:08 +02:00
|
|
|
TEST(COMPLEX_TEST, casinl) {
|
Add missing <complex.h> functions.
FreeBSD doesn't seem interested in having low-quality implementations of
these functions:
cacoshl, cacosl, casinhl, casinl, catanhl, catanl, ccoshl, ccosl, cexpl,
clog, clogf, clogl, cpow, cpowf, cpowl, csinhl, csinl, ctanhl, ctanl.
And they still haven't got round to writing good implementations, so for
now let's just take the NetBSD ones so we have the full set.
Bug: http://b/27555792
Change-Id: I6b72003cf749b1043f006377a01fffe5e1d659bc
2016-03-11 23:49:13 +01:00
|
|
|
ASSERT_EQ(0.0, casinl(0));
|
|
|
|
}
|
|
|
|
|
2017-09-15 00:30:08 +02:00
|
|
|
TEST(COMPLEX_TEST, casinh) {
|
2014-11-06 20:16:55 +01:00
|
|
|
ASSERT_EQ(0.0, casinh(0));
|
|
|
|
}
|
|
|
|
|
2017-09-15 00:30:08 +02:00
|
|
|
TEST(COMPLEX_TEST, casinhf) {
|
2014-11-06 20:16:55 +01:00
|
|
|
ASSERT_EQ(0.0, casinhf(0));
|
|
|
|
}
|
|
|
|
|
2017-09-15 00:30:08 +02:00
|
|
|
TEST(COMPLEX_TEST, casinhl) {
|
Add missing <complex.h> functions.
FreeBSD doesn't seem interested in having low-quality implementations of
these functions:
cacoshl, cacosl, casinhl, casinl, catanhl, catanl, ccoshl, ccosl, cexpl,
clog, clogf, clogl, cpow, cpowf, cpowl, csinhl, csinl, ctanhl, ctanl.
And they still haven't got round to writing good implementations, so for
now let's just take the NetBSD ones so we have the full set.
Bug: http://b/27555792
Change-Id: I6b72003cf749b1043f006377a01fffe5e1d659bc
2016-03-11 23:49:13 +01:00
|
|
|
ASSERT_EQ(0.0, casinhl(0));
|
|
|
|
}
|
|
|
|
|
2017-09-15 00:30:08 +02:00
|
|
|
TEST(COMPLEX_TEST, catan) {
|
2014-11-06 20:16:55 +01:00
|
|
|
ASSERT_EQ(0.0, catan(0));
|
|
|
|
}
|
|
|
|
|
2017-09-15 00:30:08 +02:00
|
|
|
TEST(COMPLEX_TEST, catanf) {
|
2014-11-06 20:16:55 +01:00
|
|
|
ASSERT_EQ(0.0, catanf(0));
|
|
|
|
}
|
|
|
|
|
2017-09-15 00:30:08 +02:00
|
|
|
TEST(COMPLEX_TEST, catanl) {
|
Add missing <complex.h> functions.
FreeBSD doesn't seem interested in having low-quality implementations of
these functions:
cacoshl, cacosl, casinhl, casinl, catanhl, catanl, ccoshl, ccosl, cexpl,
clog, clogf, clogl, cpow, cpowf, cpowl, csinhl, csinl, ctanhl, ctanl.
And they still haven't got round to writing good implementations, so for
now let's just take the NetBSD ones so we have the full set.
Bug: http://b/27555792
Change-Id: I6b72003cf749b1043f006377a01fffe5e1d659bc
2016-03-11 23:49:13 +01:00
|
|
|
ASSERT_EQ(0.0, catanl(0));
|
|
|
|
}
|
|
|
|
|
2017-09-15 00:30:08 +02:00
|
|
|
TEST(COMPLEX_TEST, catanh) {
|
2014-11-06 20:16:55 +01:00
|
|
|
ASSERT_EQ(0.0, catanh(0));
|
|
|
|
}
|
|
|
|
|
2017-09-15 00:30:08 +02:00
|
|
|
TEST(COMPLEX_TEST, catanhf) {
|
2014-11-06 20:16:55 +01:00
|
|
|
ASSERT_EQ(0.0, catanhf(0));
|
|
|
|
}
|
|
|
|
|
2017-09-15 00:30:08 +02:00
|
|
|
TEST(COMPLEX_TEST, catanhl) {
|
Add missing <complex.h> functions.
FreeBSD doesn't seem interested in having low-quality implementations of
these functions:
cacoshl, cacosl, casinhl, casinl, catanhl, catanl, ccoshl, ccosl, cexpl,
clog, clogf, clogl, cpow, cpowf, cpowl, csinhl, csinl, ctanhl, ctanl.
And they still haven't got round to writing good implementations, so for
now let's just take the NetBSD ones so we have the full set.
Bug: http://b/27555792
Change-Id: I6b72003cf749b1043f006377a01fffe5e1d659bc
2016-03-11 23:49:13 +01:00
|
|
|
ASSERT_EQ(0.0, catanhl(0));
|
|
|
|
}
|
|
|
|
|
2017-09-15 00:30:08 +02:00
|
|
|
TEST(COMPLEX_TEST, ccos) {
|
2014-11-06 20:16:55 +01:00
|
|
|
ASSERT_EQ(1.0, ccos(0));
|
|
|
|
}
|
|
|
|
|
2017-09-15 00:30:08 +02:00
|
|
|
TEST(COMPLEX_TEST, ccosf) {
|
2014-11-06 20:16:55 +01:00
|
|
|
ASSERT_EQ(1.0, ccosf(0));
|
|
|
|
}
|
|
|
|
|
2017-09-15 00:30:08 +02:00
|
|
|
TEST(COMPLEX_TEST, ccosl) {
|
Add missing <complex.h> functions.
FreeBSD doesn't seem interested in having low-quality implementations of
these functions:
cacoshl, cacosl, casinhl, casinl, catanhl, catanl, ccoshl, ccosl, cexpl,
clog, clogf, clogl, cpow, cpowf, cpowl, csinhl, csinl, ctanhl, ctanl.
And they still haven't got round to writing good implementations, so for
now let's just take the NetBSD ones so we have the full set.
Bug: http://b/27555792
Change-Id: I6b72003cf749b1043f006377a01fffe5e1d659bc
2016-03-11 23:49:13 +01:00
|
|
|
ASSERT_EQ(1.0, ccosl(0));
|
|
|
|
}
|
|
|
|
|
2017-09-15 00:30:08 +02:00
|
|
|
TEST(COMPLEX_TEST, ccosh) {
|
2014-11-06 20:16:55 +01:00
|
|
|
ASSERT_EQ(1.0, ccosh(0));
|
|
|
|
}
|
|
|
|
|
2017-09-15 00:30:08 +02:00
|
|
|
TEST(COMPLEX_TEST, ccoshf) {
|
2014-11-06 20:16:55 +01:00
|
|
|
ASSERT_EQ(1.0, ccoshf(0));
|
|
|
|
}
|
|
|
|
|
2017-09-15 00:30:08 +02:00
|
|
|
TEST(COMPLEX_TEST, ccoshl) {
|
Add missing <complex.h> functions.
FreeBSD doesn't seem interested in having low-quality implementations of
these functions:
cacoshl, cacosl, casinhl, casinl, catanhl, catanl, ccoshl, ccosl, cexpl,
clog, clogf, clogl, cpow, cpowf, cpowl, csinhl, csinl, ctanhl, ctanl.
And they still haven't got round to writing good implementations, so for
now let's just take the NetBSD ones so we have the full set.
Bug: http://b/27555792
Change-Id: I6b72003cf749b1043f006377a01fffe5e1d659bc
2016-03-11 23:49:13 +01:00
|
|
|
ASSERT_EQ(1.0, ccoshl(0));
|
|
|
|
}
|
|
|
|
|
2017-09-15 00:30:08 +02:00
|
|
|
TEST(COMPLEX_TEST, cexp) {
|
2014-11-06 20:16:55 +01:00
|
|
|
ASSERT_EQ(1.0, cexp(0));
|
|
|
|
}
|
|
|
|
|
2017-09-15 00:30:08 +02:00
|
|
|
TEST(COMPLEX_TEST, cexpf) {
|
2014-11-06 20:16:55 +01:00
|
|
|
ASSERT_EQ(1.0, cexpf(0));
|
|
|
|
}
|
|
|
|
|
2017-09-15 00:30:08 +02:00
|
|
|
TEST(COMPLEX_TEST, cexpl) {
|
Add missing <complex.h> functions.
FreeBSD doesn't seem interested in having low-quality implementations of
these functions:
cacoshl, cacosl, casinhl, casinl, catanhl, catanl, ccoshl, ccosl, cexpl,
clog, clogf, clogl, cpow, cpowf, cpowl, csinhl, csinl, ctanhl, ctanl.
And they still haven't got round to writing good implementations, so for
now let's just take the NetBSD ones so we have the full set.
Bug: http://b/27555792
Change-Id: I6b72003cf749b1043f006377a01fffe5e1d659bc
2016-03-11 23:49:13 +01:00
|
|
|
ASSERT_EQ(1.0, cexpl(0));
|
|
|
|
}
|
|
|
|
|
2017-09-15 00:30:08 +02:00
|
|
|
TEST(COMPLEX_TEST, cimag) {
|
2014-11-06 20:16:55 +01:00
|
|
|
ASSERT_EQ(0.0, cimag(0));
|
|
|
|
}
|
|
|
|
|
2017-09-15 00:30:08 +02:00
|
|
|
TEST(COMPLEX_TEST, cimagf) {
|
2014-11-06 20:16:55 +01:00
|
|
|
ASSERT_EQ(0.0f, cimagf(0));
|
|
|
|
}
|
|
|
|
|
2017-09-15 00:30:08 +02:00
|
|
|
TEST(COMPLEX_TEST, cimagl) {
|
2014-11-06 20:16:55 +01:00
|
|
|
ASSERT_EQ(0.0, cimagl(0));
|
|
|
|
}
|
|
|
|
|
2017-09-15 00:30:08 +02:00
|
|
|
TEST(COMPLEX_TEST, clog) {
|
Add missing <complex.h> functions.
FreeBSD doesn't seem interested in having low-quality implementations of
these functions:
cacoshl, cacosl, casinhl, casinl, catanhl, catanl, ccoshl, ccosl, cexpl,
clog, clogf, clogl, cpow, cpowf, cpowl, csinhl, csinl, ctanhl, ctanl.
And they still haven't got round to writing good implementations, so for
now let's just take the NetBSD ones so we have the full set.
Bug: http://b/27555792
Change-Id: I6b72003cf749b1043f006377a01fffe5e1d659bc
2016-03-11 23:49:13 +01:00
|
|
|
ASSERT_EQ(0.0, clog(1.0));
|
|
|
|
}
|
|
|
|
|
2017-09-15 00:30:08 +02:00
|
|
|
TEST(COMPLEX_TEST, clogf) {
|
Add missing <complex.h> functions.
FreeBSD doesn't seem interested in having low-quality implementations of
these functions:
cacoshl, cacosl, casinhl, casinl, catanhl, catanl, ccoshl, ccosl, cexpl,
clog, clogf, clogl, cpow, cpowf, cpowl, csinhl, csinl, ctanhl, ctanl.
And they still haven't got round to writing good implementations, so for
now let's just take the NetBSD ones so we have the full set.
Bug: http://b/27555792
Change-Id: I6b72003cf749b1043f006377a01fffe5e1d659bc
2016-03-11 23:49:13 +01:00
|
|
|
ASSERT_EQ(0.0f, clogf(1.0f));
|
|
|
|
}
|
|
|
|
|
2017-09-15 00:30:08 +02:00
|
|
|
TEST(COMPLEX_TEST, clogl) {
|
Add missing <complex.h> functions.
FreeBSD doesn't seem interested in having low-quality implementations of
these functions:
cacoshl, cacosl, casinhl, casinl, catanhl, catanl, ccoshl, ccosl, cexpl,
clog, clogf, clogl, cpow, cpowf, cpowl, csinhl, csinl, ctanhl, ctanl.
And they still haven't got round to writing good implementations, so for
now let's just take the NetBSD ones so we have the full set.
Bug: http://b/27555792
Change-Id: I6b72003cf749b1043f006377a01fffe5e1d659bc
2016-03-11 23:49:13 +01:00
|
|
|
ASSERT_EQ(0.0L, clogl(1.0L));
|
|
|
|
}
|
|
|
|
|
2017-09-15 00:30:08 +02:00
|
|
|
TEST(COMPLEX_TEST, conj) {
|
2014-11-06 20:16:55 +01:00
|
|
|
ASSERT_EQ(0.0, conj(0));
|
|
|
|
}
|
|
|
|
|
2017-09-15 00:30:08 +02:00
|
|
|
TEST(COMPLEX_TEST, conjf) {
|
2014-11-06 20:16:55 +01:00
|
|
|
ASSERT_EQ(0.0f, conjf(0));
|
|
|
|
}
|
|
|
|
|
2017-09-15 00:30:08 +02:00
|
|
|
TEST(COMPLEX_TEST, conjl) {
|
2014-11-06 20:16:55 +01:00
|
|
|
ASSERT_EQ(0.0, conjl(0));
|
|
|
|
}
|
|
|
|
|
2017-09-15 00:30:08 +02:00
|
|
|
TEST(COMPLEX_TEST, cpow) {
|
Add missing <complex.h> functions.
FreeBSD doesn't seem interested in having low-quality implementations of
these functions:
cacoshl, cacosl, casinhl, casinl, catanhl, catanl, ccoshl, ccosl, cexpl,
clog, clogf, clogl, cpow, cpowf, cpowl, csinhl, csinl, ctanhl, ctanl.
And they still haven't got round to writing good implementations, so for
now let's just take the NetBSD ones so we have the full set.
Bug: http://b/27555792
Change-Id: I6b72003cf749b1043f006377a01fffe5e1d659bc
2016-03-11 23:49:13 +01:00
|
|
|
ASSERT_EQ(8.0, cpow(2.0, 3.0));
|
|
|
|
}
|
|
|
|
|
2017-09-15 00:30:08 +02:00
|
|
|
TEST(COMPLEX_TEST, cpowf) {
|
Add missing <complex.h> functions.
FreeBSD doesn't seem interested in having low-quality implementations of
these functions:
cacoshl, cacosl, casinhl, casinl, catanhl, catanl, ccoshl, ccosl, cexpl,
clog, clogf, clogl, cpow, cpowf, cpowl, csinhl, csinl, ctanhl, ctanl.
And they still haven't got round to writing good implementations, so for
now let's just take the NetBSD ones so we have the full set.
Bug: http://b/27555792
Change-Id: I6b72003cf749b1043f006377a01fffe5e1d659bc
2016-03-11 23:49:13 +01:00
|
|
|
ASSERT_EQ(8.0f, cpowf(2.0f, 3.0f));
|
|
|
|
}
|
|
|
|
|
2017-09-15 00:30:08 +02:00
|
|
|
TEST(COMPLEX_TEST, cpowl) {
|
Add missing <complex.h> functions.
FreeBSD doesn't seem interested in having low-quality implementations of
these functions:
cacoshl, cacosl, casinhl, casinl, catanhl, catanl, ccoshl, ccosl, cexpl,
clog, clogf, clogl, cpow, cpowf, cpowl, csinhl, csinl, ctanhl, ctanl.
And they still haven't got round to writing good implementations, so for
now let's just take the NetBSD ones so we have the full set.
Bug: http://b/27555792
Change-Id: I6b72003cf749b1043f006377a01fffe5e1d659bc
2016-03-11 23:49:13 +01:00
|
|
|
ASSERT_EQ(8.0L, cpowl(2.0L, 3.0L));
|
|
|
|
}
|
|
|
|
|
2017-09-15 00:30:08 +02:00
|
|
|
TEST(COMPLEX_TEST, cproj) {
|
2014-11-06 20:16:55 +01:00
|
|
|
ASSERT_EQ(0.0, cproj(0));
|
|
|
|
}
|
|
|
|
|
2017-09-15 00:30:08 +02:00
|
|
|
TEST(COMPLEX_TEST, cprojf) {
|
2014-11-06 20:16:55 +01:00
|
|
|
ASSERT_EQ(0.0f, cprojf(0));
|
|
|
|
}
|
|
|
|
|
2017-09-15 00:30:08 +02:00
|
|
|
TEST(COMPLEX_TEST, cprojl) {
|
2014-11-06 20:16:55 +01:00
|
|
|
ASSERT_EQ(0.0, cprojl(0));
|
|
|
|
}
|
|
|
|
|
2017-09-15 00:30:08 +02:00
|
|
|
TEST(COMPLEX_TEST, creal) {
|
Add missing <complex.h> functions.
FreeBSD doesn't seem interested in having low-quality implementations of
these functions:
cacoshl, cacosl, casinhl, casinl, catanhl, catanl, ccoshl, ccosl, cexpl,
clog, clogf, clogl, cpow, cpowf, cpowl, csinhl, csinl, ctanhl, ctanl.
And they still haven't got round to writing good implementations, so for
now let's just take the NetBSD ones so we have the full set.
Bug: http://b/27555792
Change-Id: I6b72003cf749b1043f006377a01fffe5e1d659bc
2016-03-11 23:49:13 +01:00
|
|
|
ASSERT_EQ(2.0, creal(2.0 + 3.0I));
|
2014-11-06 20:16:55 +01:00
|
|
|
}
|
|
|
|
|
2017-09-15 00:30:08 +02:00
|
|
|
TEST(COMPLEX_TEST, crealf) {
|
Add missing <complex.h> functions.
FreeBSD doesn't seem interested in having low-quality implementations of
these functions:
cacoshl, cacosl, casinhl, casinl, catanhl, catanl, ccoshl, ccosl, cexpl,
clog, clogf, clogl, cpow, cpowf, cpowl, csinhl, csinl, ctanhl, ctanl.
And they still haven't got round to writing good implementations, so for
now let's just take the NetBSD ones so we have the full set.
Bug: http://b/27555792
Change-Id: I6b72003cf749b1043f006377a01fffe5e1d659bc
2016-03-11 23:49:13 +01:00
|
|
|
ASSERT_EQ(2.0f, crealf(2.0f + 3.0fI));
|
2014-11-06 20:16:55 +01:00
|
|
|
}
|
|
|
|
|
2017-09-15 00:30:08 +02:00
|
|
|
TEST(COMPLEX_TEST, creall) {
|
Add missing <complex.h> functions.
FreeBSD doesn't seem interested in having low-quality implementations of
these functions:
cacoshl, cacosl, casinhl, casinl, catanhl, catanl, ccoshl, ccosl, cexpl,
clog, clogf, clogl, cpow, cpowf, cpowl, csinhl, csinl, ctanhl, ctanl.
And they still haven't got round to writing good implementations, so for
now let's just take the NetBSD ones so we have the full set.
Bug: http://b/27555792
Change-Id: I6b72003cf749b1043f006377a01fffe5e1d659bc
2016-03-11 23:49:13 +01:00
|
|
|
ASSERT_EQ(2.0, creall(2.0L + 3.0LI));
|
2014-11-06 20:16:55 +01:00
|
|
|
}
|
|
|
|
|
2017-09-15 00:30:08 +02:00
|
|
|
TEST(COMPLEX_TEST, csin) {
|
2014-11-06 20:16:55 +01:00
|
|
|
ASSERT_EQ(0.0, csin(0));
|
|
|
|
}
|
|
|
|
|
2017-09-15 00:30:08 +02:00
|
|
|
TEST(COMPLEX_TEST, csinf) {
|
2014-11-06 20:16:55 +01:00
|
|
|
ASSERT_EQ(0.0, csinf(0));
|
|
|
|
}
|
|
|
|
|
2017-09-15 00:30:08 +02:00
|
|
|
TEST(COMPLEX_TEST, csinl) {
|
Add missing <complex.h> functions.
FreeBSD doesn't seem interested in having low-quality implementations of
these functions:
cacoshl, cacosl, casinhl, casinl, catanhl, catanl, ccoshl, ccosl, cexpl,
clog, clogf, clogl, cpow, cpowf, cpowl, csinhl, csinl, ctanhl, ctanl.
And they still haven't got round to writing good implementations, so for
now let's just take the NetBSD ones so we have the full set.
Bug: http://b/27555792
Change-Id: I6b72003cf749b1043f006377a01fffe5e1d659bc
2016-03-11 23:49:13 +01:00
|
|
|
ASSERT_EQ(0.0, csinl(0));
|
|
|
|
}
|
|
|
|
|
2017-09-15 00:30:08 +02:00
|
|
|
TEST(COMPLEX_TEST, csinh) {
|
2014-11-06 20:16:55 +01:00
|
|
|
ASSERT_EQ(0.0, csinh(0));
|
|
|
|
}
|
|
|
|
|
2017-09-15 00:30:08 +02:00
|
|
|
TEST(COMPLEX_TEST, csinhf) {
|
2014-11-06 20:16:55 +01:00
|
|
|
ASSERT_EQ(0.0, csinhf(0));
|
|
|
|
}
|
|
|
|
|
2017-09-15 00:30:08 +02:00
|
|
|
TEST(COMPLEX_TEST, csinhl) {
|
Add missing <complex.h> functions.
FreeBSD doesn't seem interested in having low-quality implementations of
these functions:
cacoshl, cacosl, casinhl, casinl, catanhl, catanl, ccoshl, ccosl, cexpl,
clog, clogf, clogl, cpow, cpowf, cpowl, csinhl, csinl, ctanhl, ctanl.
And they still haven't got round to writing good implementations, so for
now let's just take the NetBSD ones so we have the full set.
Bug: http://b/27555792
Change-Id: I6b72003cf749b1043f006377a01fffe5e1d659bc
2016-03-11 23:49:13 +01:00
|
|
|
ASSERT_EQ(0.0, csinhl(0));
|
|
|
|
}
|
|
|
|
|
2017-09-15 00:30:08 +02:00
|
|
|
TEST(COMPLEX_TEST, csqrt) {
|
2014-11-06 20:16:55 +01:00
|
|
|
ASSERT_EQ(0.0, csqrt(0));
|
|
|
|
}
|
|
|
|
|
2017-09-15 00:30:08 +02:00
|
|
|
TEST(COMPLEX_TEST, csqrtf) {
|
2016-09-26 18:35:04 +02:00
|
|
|
ASSERT_EQ(0.0f, csqrtf(0));
|
2014-11-06 20:16:55 +01:00
|
|
|
}
|
|
|
|
|
2017-09-15 00:30:08 +02:00
|
|
|
TEST(COMPLEX_TEST, csqrtl) {
|
2014-11-06 20:16:55 +01:00
|
|
|
ASSERT_EQ(0.0, csqrtl(0));
|
|
|
|
}
|
|
|
|
|
2017-09-15 00:30:08 +02:00
|
|
|
TEST(COMPLEX_TEST, ctan) {
|
2014-11-06 20:16:55 +01:00
|
|
|
ASSERT_EQ(0.0, ctan(0));
|
|
|
|
}
|
|
|
|
|
2017-09-15 00:30:08 +02:00
|
|
|
TEST(COMPLEX_TEST, ctanf) {
|
2014-11-06 20:16:55 +01:00
|
|
|
ASSERT_EQ(0.0, ctanf(0));
|
|
|
|
}
|
|
|
|
|
2017-09-15 00:30:08 +02:00
|
|
|
TEST(COMPLEX_TEST, ctanl) {
|
Add missing <complex.h> functions.
FreeBSD doesn't seem interested in having low-quality implementations of
these functions:
cacoshl, cacosl, casinhl, casinl, catanhl, catanl, ccoshl, ccosl, cexpl,
clog, clogf, clogl, cpow, cpowf, cpowl, csinhl, csinl, ctanhl, ctanl.
And they still haven't got round to writing good implementations, so for
now let's just take the NetBSD ones so we have the full set.
Bug: http://b/27555792
Change-Id: I6b72003cf749b1043f006377a01fffe5e1d659bc
2016-03-11 23:49:13 +01:00
|
|
|
ASSERT_EQ(0.0, ctanl(0));
|
|
|
|
}
|
|
|
|
|
2017-09-15 00:30:08 +02:00
|
|
|
TEST(COMPLEX_TEST, ctanh) {
|
2014-11-06 20:16:55 +01:00
|
|
|
ASSERT_EQ(0.0, ctanh(0));
|
|
|
|
}
|
|
|
|
|
2017-09-15 00:30:08 +02:00
|
|
|
TEST(COMPLEX_TEST, ctanhf) {
|
2014-11-06 20:16:55 +01:00
|
|
|
ASSERT_EQ(0.0, ctanhf(0));
|
|
|
|
}
|
Add missing <complex.h> functions.
FreeBSD doesn't seem interested in having low-quality implementations of
these functions:
cacoshl, cacosl, casinhl, casinl, catanhl, catanl, ccoshl, ccosl, cexpl,
clog, clogf, clogl, cpow, cpowf, cpowl, csinhl, csinl, ctanhl, ctanl.
And they still haven't got round to writing good implementations, so for
now let's just take the NetBSD ones so we have the full set.
Bug: http://b/27555792
Change-Id: I6b72003cf749b1043f006377a01fffe5e1d659bc
2016-03-11 23:49:13 +01:00
|
|
|
|
2017-09-15 00:30:08 +02:00
|
|
|
TEST(COMPLEX_TEST, ctanhl) {
|
Add missing <complex.h> functions.
FreeBSD doesn't seem interested in having low-quality implementations of
these functions:
cacoshl, cacosl, casinhl, casinl, catanhl, catanl, ccoshl, ccosl, cexpl,
clog, clogf, clogl, cpow, cpowf, cpowl, csinhl, csinl, ctanhl, ctanl.
And they still haven't got round to writing good implementations, so for
now let's just take the NetBSD ones so we have the full set.
Bug: http://b/27555792
Change-Id: I6b72003cf749b1043f006377a01fffe5e1d659bc
2016-03-11 23:49:13 +01:00
|
|
|
ASSERT_EQ(0.0, ctanhl(0));
|
|
|
|
}
|