★ wanayoo — archive 1999 https://developer.mozilla.org/de/docs/Web/JavaScript/Reference/Global_Objects/Math/LN2Nouvelle recherche | Portail wanayoo

Apply your JS skills to key Mozilla projects as an MDN Fellow! http://mzl.la/MDNFellowship

mozilla
Ihre Suchergebnisse

    Math.LN2

    Zusammenfassung

    Die Math.LN2 Eigenschaft repräsentiert den natürlichen Logarithmus von 2:

    Math.LN2=ln(2)≈0.693\mathtt{\mi{Math.LN2}} = \ln(2) \approx 0.693

    Property attributes of Math.LN2
    Writable no
    Enumerable no
    Configurable no

    Beschreibung

    Weil LN2 eine statische Eigenschaft von Math ist, kann diese immer mit Math.LN2 erreicht werden, ohne dass ein Objekt von Math erstellt werden muss (Math ist kein Konstruktor).

    Beispiele

    Beispiel: Math.LN2 Benutzen

    Die folgende Funktion gibt den Logarithmus zur Basis 2 von einer Zahl zurück. Dabei wird Math.LN2 benutzt:

    function getLog2(x) {
      return Math.log(x) / Math.LN2;
    }
    
    getLog2(256) // 8

    Spezifikationen

    Spezifikation Status Kommentar
    ECMAScript 1st Edition. Implemented in JavaScript 1.0 Standard Initiale Definition.
    ECMAScript 5.1 (ECMA-262)
    Die Definition von 'Math.LN2' in dieser Spezifikation.
    Standard  
    ECMAScript 6 (ECMA-262)
    Die Definition von 'Math.LN2' in dieser Spezifikation.
    Entwurf  

    Browserkompatibilität

    Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
    Basic support (Ja) (Ja) (Ja) (Ja) (Ja)
    Feature Android Chrome for Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
    Basic support (Ja) (Ja) (Ja) (Ja) (Ja) (Ja)

    Siehe auch

    Schlagwörter des Dokuments und Mitwirkende

    Schlagwörter: 
    Mitwirkende an dieser Seite: schlagi123
    Zuletzt aktualisiert von: schlagi123,