Latest web development tutorials

C-Bibliotheksfunktionen - pow ()

C Standard-Bibliothek - <math.h> C Standard - Bibliothek - <math.h>

Beschreibung

C - BibliotheksfunktionenDoppel pow (double x, double y ) Returns xpotenzierty,dh x y.

Erklärung

Hier ist () Anweisung Funktion pow.

double pow(double x, double y)

Parameter

  • x - stellt die Quote des Gleitkommawert.
  • y - der Floating-Point - Wert , der den Index.

Rückgabewert

Die Ergebnisse dieser Funktion zurückkehrt x hoch y angehoben.

Beispiele

Das folgende Beispiel zeigt die pow () Funktion verwendet wird.

#include <stdio.h>
#include <math.h>

int main ()
{
   printf("值 8.0 ^ 3 = %lf\n", pow(8.0, 3));

   printf("值 3.05 ^ 1.98 = %lf", pow(3.05, 1.98));
   
   return(0);
}

Lassen Sie uns zusammenzustellen und um das obige Programm ausführen, die in der folgenden führen:

值 8.0 ^ 3 = 512.000000
值 3.05 ^ 1.98 = 9.097324

C Standard-Bibliothek - <math.h> C Standard - Bibliothek - <math.h>