|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjjil.core.MathPlus
public class MathPlus
Mathematical routines which are normally provided by the Java Math class but which aren't available with CLDC 1.0.
| Field Summary | |
|---|---|
static int |
PI
PI, scaled by SCALE. |
static int |
SCALE
The scale factor for this class. |
static int |
SHIFT
Number of log base 2 of SCALE. |
| Constructor Summary | |
|---|---|
MathPlus()
|
|
| Method Summary | |
|---|---|
static int |
cos(int x)
Returns the cosine of the argument, scaled by SCALE. |
static Complex |
expImag(int x)
Returns the complex number e**(ix), that is, cos x + i sin x (de Moivre's rule) |
static int |
sign(int x)
Returns sign of the argument: 0 if arg = 0, 1 if arg is > 0, -1 otherwise. |
static int |
sin(int x)
Returns the sine of the argument, scaled by SCALE. |
static int |
sqrt(int x)
Computes square root using Newton's iteration. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static int PI
public static int SCALE
public static int SHIFT
| Constructor Detail |
|---|
public MathPlus()
| Method Detail |
|---|
public static int cos(int x)
x - the angle to take the sin of (measured in radians).
public static Complex expImag(int x)
x - the number to compute the imaginary exponential of. Should be scaled
by SCALE, as is the result.
public static int sign(int x)
x - Number to take the sign of.
0 if arg = 0
1 if arg > 0
-1 if arg < 0.
public static int sin(int x)
x - the angle to take the sin of (measured in radians).
public static int sqrt(int x)
throws Error
x - number to take square root of
Error - if x < 0
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||