C cbrt () - C Standard Library

De functie cbrt () berekent de kubuswortel van een getal.

Functieprototype van cbrt ()

 dubbele cbrt (dubbele arg);

De functie cbrt () accepteert een enkel argument (in dubbel) en retourneert de kubuswortel (ook in dubbel).

 (Wiskunde) ∛x = cbrt (x) (In C-programmering)

De functie cbrt () is gedefinieerd in het header-bestand math.h.

Om de kubuswortel van type int, floatof te vinden long double, kunt u het type expliciet converteren naar de doublecast-operator.

int x = 0; dubbel resultaat; resultaat = cbrt (dubbel (x));

U kunt de cbrtf()functie ook gebruiken om specifiek met float cbrtl()te werken en om met long doubletype te werken .

lange dubbele cbrtl (lange dubbele arg); float cbrtf (float arg);

Voorbeeld: C cbrt () Functie

 #include #include int main() ( double num = 6, cubeRoot; cubeRoot = cbrt(num); printf("Cube root of %lf = %lf", num, cubeRoot); return 0; )

Uitvoer

 Kubuswortel van 6,000000 = 1,817121

Interessante artikelen...