23 February 2011

Particle tracking bugs

Tracking Monte Carlo particles (or in this case, ray traces) through a geometry can be tricky because of the subtlety of edge cases. Today I discovered that my tracking routine failed when given a direction of −0.0 . I never imagined that the existence of signed zeroes in IEEE floating point arithmetic could ever bite me.


Post a Comment