for (var i = -20; i < 20; i++) {
assertEq(Math.hypot(+0, i), Math.abs(i));
assertEq(Math.hypot(-0, i), Math.abs(i));
}
// The implementation must avoid underlow. // The implementation must avoid overflow, where possible. // The implementation must minimise rounding errors.
for (var i = 1, j = 2; i < 2; i += 0.05, j += 0.05)
assertNear(Math.hypot(i, j), Math.sqrt(i * i + j * j));
for (var i = 1, j = 2, k = 3; i < 2; i += 0.05, j += 0.05, k += 0.05)
assertNear(Math.hypot(i, j, k), Math.sqrt(i * i + j * j + k * k));
for (var i = 1, j = 2, k = 3, l = 4; i < 2; i += 0.05, j += 0.05, k += 0.05, l += 0.5)
assertNear(Math.hypot(i, j, k, l), Math.sqrt(i * i + j * j + k * k + l * l));
Messung V0.5
¤ Dauer der Verarbeitung: 0.11 Sekunden
(vorverarbeitet)
¤
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.