2 A check for a division by 0 assumed the divisor to have integer type, resulting in a wrong value for compile-time divisions by float values close to 0. There was also a divide-by-zero wanring emitted.
7 #pragma disable_warning 85
9 float m(int argc
, char **argv
)
11 int mx
= 384, x0
= 1, x1
= (mx
- 1) - 1;
12 int my
= 192, y0
= 1, y1
= (my
- 1) - 8;
13 float w1
= -0.866, w3
= -0.791, w2
= -0.24;
14 float ar
= (float)(my
*4)/(float)(mx
*3);
15 float w4
= (w3
- w1
)*(float)(y1
- y0
)/(float)(x1
- x0
)/ar
+ w2
;