niravshah00

Is this fine - ok Solved

Discussion created by niravshah00 on Apr 25, 2010
Latest reply on May 3, 2010 by niravshah00

Hi ,

I have this equation  A^x  + B^y = C^z

Now since the value of A^x can go out of range from float can i do the  - Solvedfollowing

A^x = modulusPower(A,x);

kernel float modulusPower(float number,int exponent)
{
    //biggest prime number for 2^24.
    float N = 12582917.0f;

    float result =1.0f;
    int counter =0;
    while(counter
    {
        result =  fmod(result*number,N);
        counter++;
    }
    return result;
}

Outcomes