APIdia Launch Partner
Top Description Fields Constructors Methods
jdk.internal.math

pack-priv final Class MathUtils

extends Object
Class Inheritance
Annotations
@AOTSafeClassInitializer
Imports
jdk.internal.vm.annotation.Stable, .AOTSafeClassInitializer

This class exposes package private utilities for other classes. Thus, all methods are assumed to be invoked with correct arguments, so these are not checked at all.

Field Summary

Modifier and TypeField and Description
private static final long
private static final long
private static final long
private static final long[]
g

pack-priv static final int
pack-priv static final int
pack-priv static final int
N

private static final long[]
private static final int
private static final int

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
pack-priv static int

Returns:

⌊log102q⌋.
flog10pow2
(int
The exponent of 2, which should meet |q| ≤ 6_432_162 for safe results.
q
)

Returns max{e : 10e ≤ 2q}.

pack-priv static int

Returns:

⌊log10(3/4 · 2q)⌋.
flog10threeQuartersPow2
(int
The exponent of 2, which should meet -3_606_689 ≤ q ≤ 3_150_619 for safe results.
q
)

Returns max{e : 10e ≤ 3/4 · 2q}.

pack-priv static int

Returns:

⌊log210e⌋.
flog2pow10
(int
The exponent of 10, which should meet |e| ≤ 1_838_394 for safe results.
e
)

Returns max{q : 2q ≤ 10e}.

pack-priv static long
g0(int e)

pack-priv static long
g1(int e)

pack-priv static long

Returns:

10e.
pow10
(int
The exponent which must meet 0 ≤ e ≤ N.
e
)

Returns 10e as an unsigned long.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

A_10back to summary
private static final long A_10
C_10back to summary
private static final long C_10
C_2back to summary
private static final long C_2
gback to summary
private static final long[] g
Annotations
@Stable
GE_MAXback to summary
pack-priv static final int GE_MAX
GE_MINback to summary
pack-priv static final int GE_MIN
Nback to summary
pack-priv static final int N
pow10back to summary
private static final long[] pow10
Annotations
@Stable
Q_10back to summary
private static final int Q_10
Q_2back to summary
private static final int Q_2

Constructor Detail

MathUtilsback to summary
private MathUtils()

Method Detail

flog10pow2back to summary
pack-priv static int flog10pow2(int q)

Returns max{e : 10e ≤ 2q}.

The result is correct when |q| ≤ 6_432_162. Otherwise, the result is undefined.

Parameters
q:int

The exponent of 2, which should meet |q| ≤ 6_432_162 for safe results.

Returns:int

⌊log102q⌋.

flog10threeQuartersPow2back to summary
pack-priv static int flog10threeQuartersPow2(int q)

Returns max{e : 10e ≤ 3/4 · 2q}.

The result is correct when -3_606_689 ≤ q ≤ 3_150_619. Otherwise, the result is undefined.

Parameters
q:int

The exponent of 2, which should meet -3_606_689 ≤ q ≤ 3_150_619 for safe results.

Returns:int

⌊log10(3/4 · 2q)⌋.

flog2pow10back to summary
pack-priv static int flog2pow10(int e)

Returns max{q : 2q ≤ 10e}.

The result is correct when |e| ≤ 1_838_394. Otherwise, the result is undefined.

Parameters
e:int

The exponent of 10, which should meet |e| ≤ 1_838_394 for safe results.

Returns:int

⌊log210e⌋.

g0back to summary
pack-priv static long g0(int e)
g1back to summary
pack-priv static long g1(int e)
pow10back to summary
pack-priv static long pow10(int e)

Returns 10e as an unsigned long.

Parameters
e:int

The exponent which must meet 0 ≤ e ≤ N.

Returns:long

10e.