diff options
author | 2016-04-14 10:32:52 -0700 | |
---|---|---|
committer | 2016-04-14 10:32:52 -0700 | |
commit | 6f23e945f6fd75d8d7b48d83f01976f91da0c24f (patch) | |
tree | 808906b887ce04e95281d58415adae3912c36aad /unsupported | |
parent | 72510c80e1a7406af915f0851e6bfbe605d3f436 (diff) |
Added simple test for numext::sqrt and numext::pow on fp16
Diffstat (limited to 'unsupported')
-rw-r--r-- | unsupported/test/cxx11_float16.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/unsupported/test/cxx11_float16.cpp b/unsupported/test/cxx11_float16.cpp index 2d9376d29..b437868d7 100644 --- a/unsupported/test/cxx11_float16.cpp +++ b/unsupported/test/cxx11_float16.cpp @@ -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_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_APPROX(float(numext::exp(half(EIGEN_PI))), float(20.0 + EIGEN_PI)); |