nextafter#
- ivy.nextafter(x1, x2, /, *, out=None)[source]#
Return the next floating-point value after x1 towards x2, element-wise.
- Parameters:
- Return type:
bool
- Returns:
ret – The next representable values of x1 in the direction of x2.
Examples
>>> x1 = ivy.array([1.0e-50, 2.0e+50]) >>> x2 = ivy.array([2.0, 1.0]) >>> ivy.nextafter(x1, x2) ivy.array([1.4013e-45., 3.4028e+38])
- Array.nextafter(self, x2, /, *, out=None)#
ivy.Array instance method variant of ivy.nextafter. This method simply wraps the function, and so the docstring for ivy.nextafter also applies to this method with minimal changes.
- Parameters:
self (
Array
) – First input array.x2 (
Array
) – Second input array.out (
Optional
[Array
]) – Alternate output array in which to place the result. (default:None
) The default is None.
- Return type:
Array
- Returns:
ret – The next representable values of x1 in the direction of x2.
Examples
>>> x1 = ivy.array([1.0e-50, 2.0e+50]) >>> x2 = ivy.array([2.0, 1.0]) >>> x1.nextafter(x2) ivy.array([1.4013e-45., 3.4028e+38])
- Container.nextafter(self, x2, /, *, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, out=None)#
ivy.Container instance method variant of ivy.nextafter. This method simply wraps the function, and so the docstring for ivy.nextafter also applies to this method with minimal changes.
- Parameters:
self (
Container
) – Input container containing first input array.x2 (
Container
) – Input container containing second input array.key_chains (
Optional
[Union
[List
[str
],Dict
[str
,str
]]]) – The key-chains to apply or not apply the method to. Default isNone
. (default:None
)to_apply (
bool
) – If True, the method will be applied to key_chains, otherwise key_chains (default:True
) will be skipped. Default isTrue
.prune_unapplied (
bool
) – Whether to prune key_chains for which the function was not applied. (default:False
) Default isFalse
.map_sequences (
bool
) – Whether to also map method to sequences (lists, tuples). (default:False
) Default isFalse
.out (
Optional
[Container
]) – Alternate output array in which to place the result. (default:None
) The default is None.
- Return type:
Container
- Returns:
ret – container including the next representable values of input container’s arrays, element-wise
Examples
>>> x1 = ivy.Container(a=ivy.array([1.0e-50, 2.0e+50]), ... b=ivy.array([2.0, 1.0]) >>> x2 = ivy.Container(a=ivy.array([5.5e-30]), ... b=ivy.array([-2.0])) >>> x1.nextafter(x2) { a: ivy.array([1.4013e-45., 3.4028e+38]), b: ivy.array([5.5e-30]) }