Justin Morton

Need help with square root function (sqrt) on MCF52211

Discussion created by Justin Morton on May 8, 2008
Latest reply on May 11, 2008 by Guest
I'm having problems getting the sqrt (or sqrtf) function to work properly.
My targer processor is MCF52211.  CodeWarrior version 5.7.0.

When I run using sqrt, the result is always 20.0 and and the exception handler is entered, resulting in the error: "Access Error: Error on operand write".

When I run using sqrtf, the result is a very large, incorrect number.

I've tried using different msl libraries. 
Is there a specific library I should be using or a setting somewhere that I am missing?

Thanks.

Outcomes