mirror of
https://gitlab.com/libeigen/eigen.git
synced 2024-12-21 07:19:46 +08:00
Added simple test for numext::sqrt and numext::pow on fp16
This commit is contained in:
parent
72510c80e1
commit
6f23e945f6
@ -142,6 +142,12 @@ void test_basic_functions()
|
|||||||
VERIFY_IS_EQUAL(float(numext::abs(half(3.5f))), 3.5f);
|
VERIFY_IS_EQUAL(float(numext::abs(half(3.5f))), 3.5f);
|
||||||
VERIFY_IS_EQUAL(float(numext::abs(half(-3.5f))), 3.5f);
|
VERIFY_IS_EQUAL(float(numext::abs(half(-3.5f))), 3.5f);
|
||||||
|
|
||||||
|
VERIFY_IS_APPROX(float(numext::sqrt(half(0.0f))), 0.0f);
|
||||||
|
VERIFY_IS_APPROX(float(numext::sqrt(half(4.0f))), 2.0f);
|
||||||
|
|
||||||
|
VERIFY_IS_APPROX(float(numext::pow(half(0.0f), half(1.0f))), 0.0f);
|
||||||
|
VERIFY_IS_APPROX(float(numext::pow(half(2.0f), half(2.0f))), 4.0f);
|
||||||
|
|
||||||
VERIFY_IS_EQUAL(float(numext::exp(half(0.0f))), 1.0f);
|
VERIFY_IS_EQUAL(float(numext::exp(half(0.0f))), 1.0f);
|
||||||
VERIFY_IS_APPROX(float(numext::exp(half(EIGEN_PI))), float(20.0 + EIGEN_PI));
|
VERIFY_IS_APPROX(float(numext::exp(half(EIGEN_PI))), float(20.0 + EIGEN_PI));
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user