@@ -1595,6 +1595,26 @@ def test_not_equal(ctx, data):
15951595 )
15961596
15971597
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+
15981618@pytest .mark .parametrize ("ctx" , make_unary_params ("positive" , dh .numeric_dtypes ))
15991619@given (data = st .data ())
16001620def test_positive (ctx , data ):
@@ -1813,6 +1833,7 @@ def _filter_zero(x):
18131833 ("divide" , operator .truediv , {"filter_" : lambda s : s != 0 }, None ),
18141834 ("hypot" , math .hypot , {}, None ),
18151835 ("logaddexp" , logaddexp_refimpl , {}, None ),
1836+ ("nextafter" , math .nextafter , {}, None ),
18161837 ("maximum" , max , {'strict_check' : True }, None ),
18171838 ("minimum" , min , {'strict_check' : True }, None ),
18181839 ("multiply" , operator .mul , {}, None ),
0 commit comments