Movatterモバイル変換


[0]ホーム

URL:


Skip to main content
Ctrl+K
JAX  documentation - Home

jax.lax.nextafter

Contents

jax.lax.nextafter#

jax.lax.nextafter(x1,x2)[source]#

Returns the next representable value afterx1 in the direction ofx2.

This function lowers directly to thechlo.next_after operation.

Parameters:
  • x1 (ArrayLike) – input arrays. Must have a matching floating-point dtypes. If neither isa scalar, must have the same number of dimensions and be broadcast-compatible.

  • x2 (ArrayLike) – input arrays. Must have a matching floating-point dtypes. If neither isa scalar, must have the same number of dimensions and be broadcast-compatible.

Returns:

Array of the same dtype and broadcasted shape of the inputs, containing thenext representable floating-point value afterx1 in the direction ofx2.

Return type:

Array

Notes

In some environments flush-denormal-to-zero semantics is used.This means that, around zero, this function returns strictly non-zerovalues which appear as zero in any operations. Consider this example:

>>>fromjaximportlax>>>lax.nextafter(0.0,1.0)# denormal numbers are representableArray(1.e-45, dtype=float32, weak_type=True)>>>lax.nextafter(0.0,1.0)*1# but are flushed to zeroArray(0., dtype=float32, weak_type=True)

For the smallest usable (i.e. normal) float, usetiny ofjnp.finfo.

Contents

[8]ページ先頭

©2009-2025 Movatter.jp