#endif
-/**
- * Test if x is NaN or +/- infinity.
- */
-static INLINE boolean
-is_inf_or_nan(float x)
-{
- union fi tmp;
- tmp.f = x;
- return !(int)((unsigned int)((tmp.i & 0x7fffffff)-0x7f800000) >> 31);
-}
/**
for (i = 0; i < setup->quad.nr_attrs; i++) {
debug_printf(" %d: %f %f %f %f\n", i,
v[i][0], v[i][1], v[i][2], v[i][3]);
+ if (util_is_inf_or_nan(v[i][0])) {
+ debug_printf(" NaN!\n");
+ }
}
}
#endif
debug_printf("%s one-over-area %f area %f det %f\n",
__FUNCTION__, setup->oneoverarea, area, det );
*/
- if (is_inf_or_nan(setup->oneoverarea))
+ if (util_is_inf_or_nan(setup->oneoverarea))
return FALSE;
}
/* NOTE: this is not really area but something proportional to it */
area = setup->emaj.dx * setup->emaj.dx + setup->emaj.dy * setup->emaj.dy;
- if (area == 0.0f || is_inf_or_nan(area))
+ if (area == 0.0f || util_is_inf_or_nan(area))
return FALSE;
setup->oneoverarea = 1.0f / area;