A bus error occurred when I ran this line of code. Why can't this pow() function run? What should I do?Run this code above the 1216 routine
void hwLight_GammaCorrectRGB(float *R, float *G, float *B)
{
if ( *R > 0.003 ) *R = (1.22 * ( pow(*R, ( 1/1.5 ) )) - 0.040);
else *R = 0; //1.8023 * var_R;
if ( *G > 0.003) *G = (1.22 * ( pow(*G, ( 1/1.5 ) )) - 0.040);
else *G = 0; //1.8023 * var_G;
if ( *B > 0.003 ) *B = (1.09 * ( pow(*B, ( 1/1.5 ) )) - 0.050);
else *B = 0; //1.8023 * var_B;
}
Hi Linklai, I hope you're doing well!
As a test, if you use the pow function with an integer power instead of to the power of 1/1.5, do you still get a bus error? I performed a test with two to the power of two, and it did not cause a bus error.
Please let me know of your findings.
Best regards,
Sebastian