public class Calc extends Object
Constructor and Description |
---|
Calc() |
Modifier and Type | Method and Description |
---|---|
static long |
ceil(double v)
Round a value up to nearest integer and return value as a long.
|
static long |
floor(double v)
Round a value down to nearest integer and return value as a long.
|
static double |
perform(double v1,
String operation,
double v2)
Perform an operation on two arguments.
|
static double |
perform(double v1,
String operation,
String v2)
Perform an operation on two arguments.
|
static double |
perform(int v1,
String operation,
String v2)
Perform an operation on two arguments.
|
static double |
perform(long v1,
String operation,
long v2)
Perform an operation on two arguments.
|
static double |
perform(long v1,
String operation,
String v2)
Perform an operation on two arguments.
|
static double |
perform(String v1,
String operation,
double v2)
Perform an operation on two arguments.
|
static double |
perform(String v1,
String operation,
int v2)
Perform an operation on two arguments.
|
static double |
perform(String v1,
String operation,
long v2)
Perform an operation on two arguments.
|
static double |
perform(String v1,
String operation,
String v2)
Perform an operation on two arguments.
|
static double |
sum(ArrayList<String> list)
Sum all the values in a list.
|
public static double perform(double v1, String operation, double v2)
v1
- the first operandoperation
- the symbol for the operation. Allowed values are: -, +, *, /, %v2
- the second operandpublic static double perform(String v1, String operation, String v2)
v1
- the first operandoperation
- the symbol for the operation. Allowed values are: -, +, *, /, %v2
- the second operandpublic static double perform(long v1, String operation, String v2)
v1
- the first operandoperation
- the symbol for the operation. Allowed values are: -, +, *, /, %v2
- the second operandpublic static double perform(int v1, String operation, String v2)
v1
- the first operandoperation
- the symbol for the operation. Allowed values are: -, +, *, /, %v2
- the second operandpublic static double perform(double v1, String operation, String v2)
v1
- the first operandoperation
- the symbol for the operation. Allowed values are: -, +, *, /, %v2
- the second operandpublic static double perform(String v1, String operation, double v2)
v1
- the first operandoperation
- the symbol for the operation. Allowed values are: -, +, *, /, %v2
- the second operandpublic static double perform(String v1, String operation, long v2)
v1
- the first operandoperation
- the symbol for the operation. Allowed values are: -, +, *, /, %v2
- the second operandpublic static double perform(String v1, String operation, int v2)
v1
- the first operandoperation
- the symbol for the operation. Allowed values are: -, +, *, /, %v2
- the second operandpublic static double perform(long v1, String operation, long v2)
v1
- the first operandoperation
- the symbol for the operation. Allowed values are: -, +, *, /, %v2
- the second operandpublic static long floor(double v)
v
- the valuepublic static long ceil(double v)
v
- the valueCopyright © 2008-2009 Regents University of California. All Rights Reserved.