--- title: Math.SQRT1_2 slug: Web/JavaScript/Reference/Global_Objects/Math/SQRT1_2 tags: - JavaScript - Math - Property - Reference translation_of: Web/JavaScript/Reference/Global_Objects/Math/SQRT1_2 ---
{{JSRef}}

Die Math.SQRT1_2 Eigenschaft repräsentiert die Quadratwurzel aus 1/2, welche gerundet 0,707 ist:

Math.SQRT1_2=12=120,707\mathtt{\mi{Math.SQRT1_2}} = \sqrt{\frac{1}{2}} = \frac{1}{\sqrt{2}} \approx 0,707

{{EmbedInteractiveExample("pages/js/math-sqrt1_2.html")}}
{{js_property_attributes(0,0,0)}}

Beschreibung

Weil SQRT1_2 eine statische Eigenschaft von Math ist, muss immer Math.SQRT1_2 genutzt werden, ohne dass ein Math Objekt erstellt wird (Math ist kein Konstruktor).

Beispiele

Einsatz von Math.SQRT1_2

Die folgende Funktion gibt die Quadratwurzel aus 1/2 zurück:

function getRoot1_2() {
   return Math.SQRT1_2
}

getRoot1_2() // 0.7071067811865476

Spezifikationen

Spezifikation Status Kommentar
{{SpecName('ES1')}} {{Spec2('ES1')}} Initiale Definition. Implementiert in JavaScript 1.0.
{{SpecName('ES5.1', '#sec-15.8.1.7', 'Math.SQRT1_2')}} {{Spec2('ES5.1')}}  
{{SpecName('ES6', '#sec-math.sqrt1_2', 'Math.SQRT1_2')}} {{Spec2('ES6')}}  
{{SpecName('ESDraft', '#sec-math.sqrt1_2', 'Math.SQRT1_2')}} {{Spec2('ESDraft')}}  

Browserkompatibilität

{{Compat("javascript.builtins.Math.SQRT1_2")}}

Siehe auch