privatestaticint compareToTest(BigDecimal a, BigDecimal b, int expected) { int result = a.compareTo(b); int failed = (result==expected) ? 0 : 1; if (failed == 1) {
System.err.println("(" + a + ").compareTo(" + b + ") => " + result + "\n\tExpected " + expected);
} return failed;
}
publicstaticvoid main(String argv[]) { int failures = 0;
failures += compareToTests();
if (failures > 0) { thrownew RuntimeException("Incurred " + failures + " failures while testing exact compareTo.");
}
}
}
Messung V0.5 in Prozent
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.20Bemerkung:
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.