Movatterモバイル変換


[0]ホーム

URL:


Skip to main content
Ctrl+K
JAX  documentation - Home

jax.numpy.frexp

Contents

jax.numpy.frexp#

jax.numpy.frexp(x,/)[source]#

Split floating point values into mantissa and twos exponent.

JAX implementation ofnumpy.frexp().

Parameters:

x (ArrayLike) – real-valued array

Returns:

A tuple(mantissa,exponent) wheremantissa is a floating pointvalue between -1 and 1, andexponent is an integer such thatx==mantissa*2**exponent.

Return type:

tuple[Array,Array]

See also

Examples

Split values into mantissa and exponent:

>>>x=jnp.array([1.,2.,3.,4.,5.])>>>m,e=jnp.frexp(x)>>>mArray([0.5  , 0.5  , 0.75 , 0.5  , 0.625], dtype=float32)>>>eArray([1, 2, 2, 3, 3], dtype=int32)

Reconstruct the original array:

>>>m*2**eArray([1., 2., 3., 4., 5.], dtype=float32)
Contents

[8]ページ先頭

©2009-2025 Movatter.jp