Simpleton

02-09-2005, 11:44 PM

Hi!

I have a problem with calculating the vector's length. I use __sqrtx() from uglu.c and when I pass value greater then 2^32 (fixed limit) the function returns an undefined result. I have expanded type of passed value from GLfixed to __int64 but it has not helped. __sqrtx() uses Newton's method and does 6 compute iterations. May be it is not enough. I think I need more compute iterations, right? May be somebody can suggest any idea to help me resolve this problem. I will be very grateful. ;)

I have a problem with calculating the vector's length. I use __sqrtx() from uglu.c and when I pass value greater then 2^32 (fixed limit) the function returns an undefined result. I have expanded type of passed value from GLfixed to __int64 but it has not helped. __sqrtx() uses Newton's method and does 6 compute iterations. May be it is not enough. I think I need more compute iterations, right? May be somebody can suggest any idea to help me resolve this problem. I will be very grateful. ;)