@@ -1595,6 +1595,26 @@ def test_not_equal(ctx, data):
1595
1595
)
1596
1596
1597
1597
1598
+ @pytest .mark .min_version ("2024.12" )
1599
+ @given (
1600
+ shapes = hh .two_mutually_broadcastable_shapes ,
1601
+ dtype = hh .real_floating_dtypes ,
1602
+ data = st .data ()
1603
+ )
1604
+ def test_nextafter (shapes , dtype , data ):
1605
+ x1 = data .draw (hh .arrays (dtype = dtype , shape = shapes [0 ]), label = "x1" )
1606
+ x2 = data .draw (hh .arrays (dtype = dtype , shape = shapes [0 ]), label = "x2" )
1607
+
1608
+ out = xp .nextafter (x1 , x2 )
1609
+ _assert_correctness_binary (
1610
+ "nextafter" ,
1611
+ math .nextafter ,
1612
+ in_dtypes = [x1 .dtype , x2 .dtype ],
1613
+ in_shapes = [x1 .shape , x2 .shape ],
1614
+ in_arrs = [x1 , x2 ],
1615
+ out = out
1616
+ )
1617
+
1598
1618
@pytest .mark .parametrize ("ctx" , make_unary_params ("positive" , dh .numeric_dtypes ))
1599
1619
@given (data = st .data ())
1600
1620
def test_positive (ctx , data ):
@@ -1813,6 +1833,7 @@ def _filter_zero(x):
1813
1833
("divide" , operator .truediv , {"filter_" : lambda s : s != 0 }, None ),
1814
1834
("hypot" , math .hypot , {}, None ),
1815
1835
("logaddexp" , logaddexp_refimpl , {}, None ),
1836
+ ("nextafter" , math .nextafter , {}, None ),
1816
1837
("maximum" , max , {'strict_check' : True }, None ),
1817
1838
("minimum" , min , {'strict_check' : True }, None ),
1818
1839
("multiply" , operator .mul , {}, None ),
0 commit comments