Skip to content

Commit 68bf257

Browse files
committed
Add a "test" for divide()
There isn't really anything we can test. We may eventually want to test that output matches IEEE 754 specifications, but that is harder so we aren't doing that in general yet.
1 parent 16c939d commit 68bf257

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

array_api_tests/test_elementwise_functions.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,12 @@ def test_cosh(x):
342342
def test_divide(args):
343343
x1, x2 = args
344344
sanity_check(x1, x2)
345-
# a = _array_module.divide(x1, x2)
345+
_array_module.divide(x1, x2)
346+
# There isn't much we can test here. The spec doesn't require any behavior
347+
# beyond the special cases, and indeed, there aren't many mathematical
348+
# properties of division that strictly hold for floating-point numbers. We
349+
# could test that this does implement IEEE 754 division, but we don't yet
350+
# have those sorts in general for this module.
346351

347352
@given(two_any_dtypes.flatmap(lambda i: two_array_scalars(*i)))
348353
def test_equal(args):

0 commit comments

Comments
 (0)