Skip to content

Commit

Permalink
Negative 0.0 Handled
Browse files Browse the repository at this point in the history
  • Loading branch information
RohitSgh committed Sep 13, 2023
1 parent 5123d8e commit 3bb405f
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion docs/demos
Submodule demos updated from 8163e5 to 0491d7
1 change: 1 addition & 0 deletions ivy/functional/frontends/numpy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -638,6 +638,7 @@ def promote_types_of_numpy_inputs(

from ivy.functional.frontends.numpy.mathematical_functions.floating_point_routines import ( # noqa
_nextafter,
_signbit,
_spacing,
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,7 @@ def _signbit(
dtype=None,
subok=True,
):
if dtype is None:
dtype = ivy.dtype(x)
zero = ivy.zeros_like(x, dtype=dtype)
return ivy.less(x, zero)
return ivy.logical_or(ivy.less(x, 0), ivy.arctan2(0.0, x) == ivy.pi)


@handle_numpy_out
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def test_numpy_nextafter(
dtypes_values_casting=np_frontend_helpers.dtypes_values_casting_dtype(
arr_func=[
lambda: helpers.dtype_and_values(
available_dtypes=helpers.get_dtypes("float"),
available_dtypes=helpers.get_dtypes("valid"),
num_arrays=1,
)
],
Expand Down

0 comments on commit 3bb405f

Please sign in to comment.