Top Description Fields Constructors Methods
ch.randelshofer.fastdoubleparser

pack-priv Class BigSignificand

extends Object
Class Inheritance
Imports
java.lang.invoke.MethodHandles, .VarHandle, java.math.BigInteger, java.nio.ByteOrder

A mutable significand with a fixed number of bits.

Field Summary

Modifier and TypeField and Description
private int
private static final long
private final int
private static final VarHandle
private final byte[]
x

Constructor Summary

AccessConstructor and Description
public
BigSignificand(long numBits)

Method Summary

Modifier and TypeMethod and Description
public void
add(int
the addend, must be a non-negative value
value
)

Adds the specified value to the significand in place.

public void
fma(int
the multiplication factor, must be a non-negative value
factor
,
int
the addend, must be a non-negative value
addend
)

Multiplies the significand with the specified factor in place, and then adds the specified addend to it (also in place).

public BigInteger
private void
x(int i, int value)

private int
x(int i)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

firstNonZeroIntback to summary
private int firstNonZeroInt
LONG_MASKback to summary
private static final long LONG_MASK
numIntsback to summary
private final int numInts
readIntBEback to summary
private static final VarHandle readIntBE
xback to summary
private final byte[] x

Constructor Detail

BigSignificandback to summary
public BigSignificand(long numBits)

Method Detail

addback to summary
public void add(int value)

Adds the specified value to the significand in place.

Parameters
value:int

the addend, must be a non-negative value

Exceptions
ArrayIndexOutOfBoundsException:
on overflow
fmaback to summary
public void fma(int factor, int addend)

Multiplies the significand with the specified factor in place, and then adds the specified addend to it (also in place).

Parameters
factor:int

the multiplication factor, must be a non-negative value

addend:int

the addend, must be a non-negative value

Exceptions
ArrayIndexOutOfBoundsException:
on overflow
toBigIntegerback to summary
public BigInteger toBigInteger()
xback to summary
private void x(int i, int value)
xback to summary
private int x(int i)