public class DoubleWithAppx
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static DoubleWithAppx |
ZERO
A readily available zero value of type DoubleWithAppx
|
| Constructor and Description |
|---|
DoubleWithAppx(double passedDouble)
Initializes the new DoubleWithAppx object so that it represents the value of
the parameter.
|
DoubleWithAppx(DoubleWithAppx passedMyDouble)
Copy Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
DoubleWithAppx |
abs()
Returns the absolute value of the current object.
|
DoubleWithAppx |
add(DoubleWithAppx passedVal)
Returns the sum of the current object and the parameter.
|
int |
compareTo(DoubleWithAppx passedVal)
Compares the current object to the parameter.
|
DoubleWithAppx |
divide(DoubleWithAppx passedVal)
Returns the quotient obtained when dividing the current object by the
parameter.
|
void |
divideEquals(DoubleWithAppx passedVal)
Updates the current object to be the quotient of the current object over the parameter.
|
boolean |
equals(java.lang.Object other)
Checks if the current object is equal to the parameter.
|
boolean |
isZero()
Checks if the current object is equal to 0.
|
void |
minusEquals(DoubleWithAppx passedVal)
Updates the current object to be the difference of the parameter from the current object.
|
DoubleWithAppx |
multiply(DoubleWithAppx passedVal)
Returns the product of the current object and the parameter.
|
static DoubleWithAppx |
parseDouble(java.lang.String str)
Returns a new DoubleWithAppx initialized to the value represented by the
specified String, as performed by the valueOf method of class Double.
|
void |
plusEquals(DoubleWithAppx passedVal)
Updates the current object to be the sum of the current object and the parameter.
|
DoubleWithAppx |
power(int exp)
Returns a DoubleWithAppx representing the current object's
value raised to the indicated power.
|
DoubleWithAppx |
realroot(int degree)
Returns a DoubleWithAppx representing the root of the current
object based on the parameter.
|
DoubleWithAppx |
subtract(DoubleWithAppx passedVal)
Returns the difference obtained by subtracting the parameter from the
current object.
|
void |
timesEquals(DoubleWithAppx passedVal)
Updates the current object to be the product of the parameter and the current object.
|
java.lang.String |
toString()
YOU MAY NOT CALL THIS METHOD EXCEPT WHILE YOU ARE IMPLEMENTING
THE toString METHOD OF THE CubicPoly CLASS!!
Returns a String representation of the current object.
|
public static DoubleWithAppx ZERO
public DoubleWithAppx(double passedDouble)
passedDouble - value to be "wrapped" in the objectpublic DoubleWithAppx(DoubleWithAppx passedMyDouble)
passedMyDouble - existing DoubleWithAppx object that is being copiedpublic static DoubleWithAppx parseDouble(java.lang.String str)
str - - the string to be parsedjava.lang.NumberFormatException - - if the string does not contain a parsable
DoubleWithAppx.public DoubleWithAppx add(DoubleWithAppx passedVal)
passedVal - the value that serves as the second operand for the additionpublic void plusEquals(DoubleWithAppx passedVal)
passedVal - the value that serves as the operand for the += operationpublic DoubleWithAppx subtract(DoubleWithAppx passedVal)
passedVal - the value to be subtractedpublic void minusEquals(DoubleWithAppx passedVal)
passedVal - the value that serves as the operand for the += operationpublic DoubleWithAppx multiply(DoubleWithAppx passedVal)
passedVal - the value that serves as the second operand for the
multiplicationpublic void timesEquals(DoubleWithAppx passedVal)
passedVal - the value that serves as the operand for the += operationpublic DoubleWithAppx divide(DoubleWithAppx passedVal)
passedVal - the value that serves as the divisorpublic void divideEquals(DoubleWithAppx passedVal)
passedVal - the value that serves as the operand for the += operationpublic DoubleWithAppx realroot(int degree)
public DoubleWithAppx power(int exp)
public int compareTo(DoubleWithAppx passedVal)
passedVal - the object being compared with the current objectpublic boolean equals(java.lang.Object other)
equals in class java.lang.ObjectpassedVal - the object being compared for equality with the current
objectpublic boolean isZero()
public DoubleWithAppx abs()
public java.lang.String toString()
toString in class java.lang.Object