Sharkysoft home

lava.text
Class ScientificNotationBigDecimal

java.lang.Object
  |
  +--lava.text.ScientificNotationBigDecimal

public class ScientificNotationBigDecimal
extends java.lang.Object

Represents a BigDecimal in base-10 scientific notation.

Details: A ScientificNotationBigDecimal is a base-10 scientific notation representation of a BigDecimal.

Example: Print bd, a BigDecimal, in scientific notation.

	ScientificNotationBigDecimal snbd = new ScientificNotationBigDecimal (bd);
	System.out . print (snbd . mantissa + "*10^" + snbd . exponent);
	// or: System.out . print (snbd . toString ());

Version:
2000.02.22
See Also:
BigDecimal

Field Summary
 int exponent
          The exponent.
 java.math.BigDecimal mantissa
          The mantissa.
 
Constructor Summary
ScientificNotationBigDecimal(java.math.BigDecimal bd)
          Initializes a new ScientificNotationBigDecimal with the specified value.
ScientificNotationBigDecimal(double d)
          Initializes a new ScientificNotationBigDecimal with the specified value.
ScientificNotationBigDecimal(float f)
          Initializes a new ScientificNotationBigDecimal with the specified value.
 
Method Summary
 java.lang.String toString()
          Generates a string representation of the value represented by this BigDecimal.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

mantissa

public final java.math.BigDecimal mantissa
The mantissa.

exponent

public final int exponent
The exponent.
Constructor Detail

ScientificNotationBigDecimal

public ScientificNotationBigDecimal(java.math.BigDecimal bd)
Initializes a new ScientificNotationBigDecimal with the specified value.
Parameters:
bd - the value

ScientificNotationBigDecimal

public ScientificNotationBigDecimal(float f)
Initializes a new ScientificNotationBigDecimal with the specified value.
Parameters:
f - the value

ScientificNotationBigDecimal

public ScientificNotationBigDecimal(double d)
Initializes a new ScientificNotationBigDecimal with the specified value.
Parameters:
d - the value
Method Detail

toString

public java.lang.String toString()
Generates a string representation of the value represented by this BigDecimal. The form is "M*10^E", where M is the mantissa and E is the exponent.
Overrides:
toString in class java.lang.Object
Returns:
a string representation of this instance

Sharkysoft home