Need Help Making A Fuction Using C In Linux To Find The 4th Root Of A Number.?

Author: admin  //  Category: Linux

Look at the functions in the math.h header file. On my linux distro, math.h is located in /usr/include. To get the man page on it, type in man math.h or info math.h on your terminal. Both will bring up the documentation.
Figure out just what the 4th root is and how to compute it. The math functions in math.h should help you calculate it.
Good luck.

Tags: , , , , , , , ,

3 Responses to “Need Help Making A Fuction Using C In Linux To Find The 4th Root Of A Number.?”

  1. damnyank Says:

    Enjoy
    #include
    int errno;
    double log(), exp();
    double
    fourth_root(double arg1)
    {
    double arg2 = 0.25;
    double temp;
    long l;
    if(arg1 <= 0.) {
    if(arg1 == 0.) {
    if(arg2 <= 0.)
    goto domain;
    return(0.);
    }
    l = arg2;
    if(l != arg2)
    goto domain;
    temp = exp(arg2 * log(-arg1));
    if(l & 1)
    temp = -temp;
    return(temp);
    }
    return(exp(arg2 * log(arg1)));
    domain:
    errno = EDOM;
    return(0.);
    }

  2. WillDean Says:

    can’t you just find the square root of square root?

  3. Anonymous Says:

    Use recursion and use sqrt function to find any even root.

Leave a Reply