|
Scribble Problem Set Javadocs | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cs101.util.MoreMath
cs101.util.MoreMath is an extension of the java.lang.Math library.
Copyright 1996 Massachusetts Institute of Technology
Method Summary | |
static int |
randomInt(int range)
Generate a random int between 0 and range. |
static int |
sign(int x)
Returns 1 if the input is positive, -1 if it is negative, and 0 otherwise. |
static int |
square(int x)
Returns the square of the input. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static int randomInt(int range)
range
- desired maximum int.public static int square(int x)
x
- the number to squarepublic static int sign(int x)
x
- the number to get the sign of
|
Scribble Problem Set Javadocs | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |