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. |
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 |
mantissa
public final java.math.BigDecimal mantissa
- The mantissa.
exponent
public final int exponent
- The exponent.
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
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