|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object demo.Etumerkki
public class Etumerkki
Ohjelmalla testataan luvun kuulumista tietylle välille. Samalla esimerkki automaattisesta testaamisesta.
Constructor Summary | |
---|---|
Etumerkki()
|
Method Summary | |
---|---|
static int |
etumerkki(double x,
double eps)
Funktiolla testataan onko x eps:in tarkkuudella 0. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Etumerkki()
Method Detail |
---|
public static int etumerkki(double x, double eps)
if ( etumerkki(x-5.7,0.01) == 0 ) System.out.println(" x = 5.7 ");
x
- tutkittava lukueps
- tarkkuus joka halutaan
etumerkki(-3.0,0.01) === -1; etumerkki(-0.0001,0.01) === 0; etumerkki(0.0,0.01) === 0; etumerkki(0.0001,0.01) === 0; etumerkki(3.0,0.01) === 1;
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |