|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.latexdraw.util.LNumber
public final class LNumber
The class define some useful methods to manage numbers.
This file is part of LaTeXDraw.
Copyright(c) 2005-2012 Arnaud BLOUIN
LaTeXDraw is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
any later version.
LaTeXDraw is distributed without any warranty; without even the
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the GNU General Public License for more details.
12/18/06
Field Summary | |
---|---|
static LNumber |
INSTANCE
The singleton. |
static double |
THRESHOLD
The threshold used to compare double values. |
Constructor Summary | |
---|---|
private |
LNumber()
|
Method Summary | |
---|---|
boolean |
equals(double a,
double b)
Compares two double values to know if they are approximatively equal. |
boolean |
equals(double a,
double b,
double threshold)
Compares two double values to know if they are approximately equal. |
double |
getCutNumber(double value)
See getCutNumber(double value, double threshold). |
double |
getCutNumber(double value,
double threshold)
This method allows to set a threshold that if a number is under it, it will be considered as valuing 0; for instance, given the numbers 2E-10 and 0.002 and the threshold 0.00001; then this method will cut the first number and will return 0. |
float |
getCutNumber(float value)
See getCutNumber(float value, double threshold). |
float |
getCutNumber(float value,
double threshold)
This method allows to set a threshold that if a number is under it, it will be considered as valuing 0; for instance, given the numbers 2E-10 and 0.002 and the threshold 0.00001; then this method will cut the first number and will return 0. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final LNumber INSTANCE
public static final double THRESHOLD
Constructor Detail |
---|
private LNumber()
Method Detail |
---|
public boolean equals(double a, double b, double threshold)
a
- The first double value.b
- The second double value.threshold
- The threshold used to compare the given values.
public boolean equals(double a, double b)
a
- The first double value.b
- The second double value.
public float getCutNumber(float value)
value
- The value to cut.
public double getCutNumber(double value)
value
- The value to cut.
public float getCutNumber(float value, double threshold)
value
- The number to check.threshold
- The minimum threshold of the value.
public double getCutNumber(double value, double threshold)
value
- The number to check.threshold
- The minimum threshold of the value.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |