|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.jinx.slowmath.MathUtil
public class MathUtil
Programs using the math library should construct their initial values via
this class. It allows parsing data in a type-neutral way. This way, you can
change a single line of code in your program (or use a command-line switch),
and it changes the precision of the whole system.
API Stability: Beta.
Method Summary | |
---|---|
static Real |
e()
|
static void |
main(java.lang.String[] args)
Performs a test of this library. |
static Real |
negOne()
|
static Real |
one()
|
static Real |
oneHalf()
|
static Real |
parseReal(java.lang.String s)
Parses a value from the String. |
static Vector |
parseVector(java.lang.String s)
Parses a Vector from the String. |
static Real |
pi()
|
static void |
setType(java.lang.String type)
Sets what type this class should use to construct new Real instances. |
static Real |
two()
|
static Real |
wrapDouble(double v)
Constructs a type-neutral Real for the given double. |
static Real |
wrapLong(long v)
Wraps a long in a Real in a type-neutral manner. |
static Real |
zero()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static void main(java.lang.String[] args)
public static void setType(java.lang.String type)
type
- right now, this can be either "float" or "double".public static Real wrapDouble(double v)
v
- the double value.public static Real wrapLong(long v)
v
- the long value.
public static Real parseReal(java.lang.String s)
s
- the String to parse.public static Vector parseVector(java.lang.String s)
s
- the String to parse.
java.lang.IllegalArgumentException
- if s has less than or more than three
elements encoded in it.public static Real zero()
public static Real one()
public static Real oneHalf()
public static Real negOne()
public static Real two()
public static Real e()
public static Real pi()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |