Update of /var/cvs/speeltuin/mihxil/statistics/src/org/mmbase/util/math
In directory james.mmbase.org:/tmp/cvs-serv27537/src/org/mmbase/util/math
Modified Files:
Measurement.java
Log Message:
added some documentation, some bugfixes
See also:
http://cvs.mmbase.org/viewcvs/speeltuin/mihxil/statistics/src/org/mmbase/util/math
Index: Measurement.java
===================================================================
RCS file:
/var/cvs/speeltuin/mihxil/statistics/src/org/mmbase/util/math/Measurement.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- Measurement.java 15 Oct 2008 13:05:41 -0000 1.5
+++ Measurement.java 15 Oct 2008 14:48:06 -0000 1.6
@@ -19,7 +19,7 @@
*
* @author Michiel Meeuwissen
* @since mm-statistics-1.0
- * @version $Id: Measurement.java,v 1.5 2008/10/15 13:05:41 michiel Exp $
+ * @version $Id: Measurement.java,v 1.6 2008/10/15 14:48:06 michiel Exp $
*/
@@ -164,7 +164,7 @@
/**
* The minimum exponent defined how close a number must be to 1, to not
use scientific notation
- * for it. Defaults to 4, which means that numbers between 0.001 and 10000
(and -0.001 and
+ * for it. Defaults to 4, which means that numbers between 0.0001 and
10000 (and -0.0001 and
* -10000) are presented without useage of scientific notation
*/
public void setMinimumExponent(int m) {
@@ -173,7 +173,7 @@
/**
- * Split a double up in 2 numbers, a double approximeately 1 (the
'coefficent'), and an integer
+ * Split a double up in 2 numbers: a double approximately 1 (the
'coefficent'), and an integer
* indicating the order of magnitude (the 'exponent').
*/
private static class SplitNumber {
@@ -188,9 +188,10 @@
exponent++;
}
while (coefficient > 0 && coefficient < 0.1) {
- coefficient /=10;
+ coefficient *=10;
exponent--;
}
+ if (negative) coefficient *= -1;
}
public String toString() {
return coefficient + "\u00B710" + superscript(exponent);
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs