December 21st, 2012, 11:55 PM
Very Simple question about checking zero value ..
Dear All ,
To calculate line slope I am using formula ,
line_slope = (meanxy - (meanx * meany)) / (meanyy) - (meany * meany));
All the variables are floats.
How to check whether the denominator .. (meanyy)- (meany * meany)) is zero ? Cause its float.
can I check with ..
float f1 = (meanyy) - (meany * meany) ;
if (f1 == 0.0) ..
Will this work surely ?
I am using this formula in project based on winXP but it survived. As soon as I ported the code
on DPMI based code , I observed a system hang after some time if all the points I supply are (0,0)
while drawing a line.
Thanks a lot in advance
Click Here to Expand Forum to Full Width