Name
Math.sqrt() — Berechnet eine Quadratwurzelorm:availability:
Überblick
Math.sqrt(x
)
Argumente
x
Ein numerischer Wert größer oder gleich null.
Rückgabewert
Die Quadratwurzel von x
. Gibt NaN
zurück, wenn x
kleiner als null ist.
Beschreibung
Math.sqrt()
berechnet die Quadratwurzel einer Zahl. Sie können aber auch mit Math.pow()
beliebige Wurzeln ausrechnen. Ein Beispiel:
Math.cuberoot = function(x){ return Math.pow(x,1/3); } Math.cuberoot(8); // Gibt 2 zurück
Get JavaScript: Das umfassende Referenzwerk, Sixth Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.