diff options
author | Antonio Sanchez <cantonios@google.com> | 2021-03-15 13:00:32 -0700 |
---|---|---|
committer | Antonio Sanchez <cantonios@google.com> | 2021-03-15 13:32:24 -0700 |
commit | f612df273689a19d25b45ca4f8269463207c4fee (patch) | |
tree | e2ac42271047c9718e807e56987727741ebf22b6 /test | |
parent | 14b7ebea11808b2e44995e4a5cd668f1da4071c0 (diff) |
Add fmod(half, half).
This is to support TensorFlow's `tf.math.floormod` for half.
Diffstat (limited to 'test')
-rw-r--r-- | test/half_float.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/half_float.cpp b/test/half_float.cpp index 1cfe69e93..729de1bc7 100644 --- a/test/half_float.cpp +++ b/test/half_float.cpp @@ -268,6 +268,11 @@ void test_basic_functions() VERIFY_IS_EQUAL(float(log1p(half(0.0f))), 0.0f); VERIFY_IS_APPROX(float(numext::log1p(half(10.0f))), 2.3978953f); VERIFY_IS_APPROX(float(log1p(half(10.0f))), 2.3978953f); + + VERIFY_IS_APPROX(numext::fmod(half(5.3f), half(2.0f)), half(1.3f)); + VERIFY_IS_APPROX(fmod(half(5.3f), half(2.0f)), half(1.3f)); + VERIFY_IS_APPROX(numext::fmod(half(-18.5f), half(-4.2f)), half(-1.7f)); + VERIFY_IS_APPROX(fmod(half(-18.5f), half(-4.2f)), half(-1.7f)); } void test_trigonometric_functions() |