java.lang
Class FloatingDecimal

java.lang.Object
  extended byjava.lang.FloatingDecimal

class FloatingDecimal
extends Object


Field Summary
private static FDBigInt[] b5p
           
private static double[] big10pow
           
(package private) static int bigDecimalExponent
           
(package private)  int bigIntExp
           
(package private)  int bigIntNBits
           
(package private)  int decExponent
           
(package private)  char[] digits
           
(package private) static int expBias
           
(package private) static long expMask
           
(package private) static long expOne
           
(package private) static int expShift
           
(package private) static long fractHOB
           
(package private) static long fractMask
           
(package private) static long highbit
           
(package private) static long highbyte
           
private static char[] infinity
           
(package private) static int intDecimalDigits
           
(package private)  boolean isExceptional
           
(package private)  boolean isNegative
           
private static long[] long5pow
           
(package private) static long lowbytes
           
(package private) static int maxDecimalDigits
           
(package private) static int maxDecimalExponent
           
(package private) static int maxSmallBinExp
           
private static int maxSmallTen
           
(package private) static int minDecimalExponent
           
(package private) static int minSmallBinExp
           
(package private)  boolean mustSetRoundDir
           
private static int[] n5bits
           
(package private)  int nDigits
           
private static char[] notANumber
           
private static ThreadLocal perThreadBuffer
           
(package private)  int roundDir
           
(package private) static long signMask
           
(package private) static int singleExpBias
           
(package private) static int singleExpMask
           
(package private) static int singleExpShift
           
(package private) static int singleFractHOB
           
(package private) static int singleFractMask
           
(package private) static int singleMaxDecimalDigits
           
(package private) static int singleMaxDecimalExponent
           
private static int singleMaxSmallTen
           
(package private) static int singleMinDecimalExponent
           
(package private) static int singleSignMask
           
private static float[] singleSmall10pow
           
private static double[] small10pow
           
private static int[] small5pow
           
private static double[] tiny10pow
           
private static char[] zero
           
 
Constructor Summary
private FloatingDecimal(boolean negSign, int decExponent, char[] digits, int n, boolean e)
           
  FloatingDecimal(double d)
           
  FloatingDecimal(float f)
           
 
Method Summary
(package private)  void appendTo(StringBuffer buf)
           
private static FDBigInt big5pow(int p)
           
private static FDBigInt constructPow52(int p5, int p2)
           
private static int countBits(long v)
           
private  void developLongDigits(int decExponent, long lvalue, long insignificant)
           
private  FDBigInt doubleToBigInt(double dval)
           
 double doubleValue()
           
private  void dtoa(int binExp, long fractBits, int nSignificantBits)
           
 float floatValue()
           
private  int getChars(char[] result)
           
private static FDBigInt multPow52(FDBigInt v, int p5, int p2)
           
static FloatingDecimal readJavaFormatString(String in)
           
private  void roundup()
           
(package private)  float stickyRound(double dval)
           
 String toJavaFormatString()
           
 String toString()
          Returns a string representation of the object.
private static double ulp(double dval, boolean subtracting)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

isExceptional

boolean isExceptional

isNegative

boolean isNegative

decExponent

int decExponent

digits

char[] digits

nDigits

int nDigits

bigIntExp

int bigIntExp

bigIntNBits

int bigIntNBits

mustSetRoundDir

boolean mustSetRoundDir

roundDir

int roundDir

signMask

static final long signMask
See Also:
Constant Field Values

expMask

static final long expMask
See Also:
Constant Field Values

fractMask

static final long fractMask
See Also:
Constant Field Values

expShift

static final int expShift
See Also:
Constant Field Values

expBias

static final int expBias
See Also:
Constant Field Values

fractHOB

static final long fractHOB
See Also:
Constant Field Values

expOne

static final long expOne
See Also:
Constant Field Values

maxSmallBinExp

static final int maxSmallBinExp
See Also:
Constant Field Values

minSmallBinExp

static final int minSmallBinExp
See Also:
Constant Field Values

maxDecimalDigits

static final int maxDecimalDigits
See Also:
Constant Field Values

maxDecimalExponent

static final int maxDecimalExponent
See Also:
Constant Field Values

minDecimalExponent

static final int minDecimalExponent
See Also:
Constant Field Values

bigDecimalExponent

static final int bigDecimalExponent
See Also:
Constant Field Values

highbyte

static final long highbyte
See Also:
Constant Field Values

highbit

static final long highbit
See Also:
Constant Field Values

lowbytes

static final long lowbytes
See Also:
Constant Field Values

singleSignMask

static final int singleSignMask
See Also:
Constant Field Values

singleExpMask

static final int singleExpMask
See Also:
Constant Field Values

singleFractMask

static final int singleFractMask
See Also:
Constant Field Values

singleExpShift

static final int singleExpShift
See Also:
Constant Field Values

singleFractHOB

static final int singleFractHOB
See Also:
Constant Field Values

singleExpBias

static final int singleExpBias
See Also:
Constant Field Values

singleMaxDecimalDigits

static final int singleMaxDecimalDigits
See Also:
Constant Field Values

singleMaxDecimalExponent

static final int singleMaxDecimalExponent
See Also:
Constant Field Values

singleMinDecimalExponent

static final int singleMinDecimalExponent
See Also:
Constant Field Values

intDecimalDigits

static final int intDecimalDigits
See Also:
Constant Field Values

b5p

private static FDBigInt[] b5p

perThreadBuffer

private static ThreadLocal perThreadBuffer

small10pow

private static final double[] small10pow

singleSmall10pow

private static final float[] singleSmall10pow

big10pow

private static final double[] big10pow

tiny10pow

private static final double[] tiny10pow

maxSmallTen

private static final int maxSmallTen

singleMaxSmallTen

private static final int singleMaxSmallTen

small5pow

private static final int[] small5pow

long5pow

private static final long[] long5pow

n5bits

private static final int[] n5bits

infinity

private static final char[] infinity

notANumber

private static final char[] notANumber

zero

private static final char[] zero
Constructor Detail

FloatingDecimal

private FloatingDecimal(boolean negSign,
                        int decExponent,
                        char[] digits,
                        int n,
                        boolean e)

FloatingDecimal

public FloatingDecimal(double d)

FloatingDecimal

public FloatingDecimal(float f)
Method Detail

countBits

private static int countBits(long v)

big5pow

private static FDBigInt big5pow(int p)

multPow52

private static FDBigInt multPow52(FDBigInt v,
                                  int p5,
                                  int p2)

constructPow52

private static FDBigInt constructPow52(int p5,
                                       int p2)

doubleToBigInt

private FDBigInt doubleToBigInt(double dval)

ulp

private static double ulp(double dval,
                          boolean subtracting)

stickyRound

float stickyRound(double dval)

developLongDigits

private void developLongDigits(int decExponent,
                               long lvalue,
                               long insignificant)

roundup

private void roundup()

dtoa

private void dtoa(int binExp,
                  long fractBits,
                  int nSignificantBits)

toString

public String toString()
Description copied from class: Object
Returns a string representation of the object. In general, the toString method returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method.

The toString method for class Object returns a string consisting of the name of the class of which the object is an instance, the at-sign character `@', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of:

 getClass().getName() + '@' + Integer.toHexString(hashCode())
 

Overrides:
toString in class Object
Returns:
a string representation of the object.

toJavaFormatString

public String toJavaFormatString()

getChars

private int getChars(char[] result)

appendTo

void appendTo(StringBuffer buf)

readJavaFormatString

public static FloatingDecimal readJavaFormatString(String in)
                                            throws NumberFormatException
Throws:
NumberFormatException

doubleValue

public double doubleValue()

floatValue

public float floatValue()