Re: [AD] div by zero....color.c |
[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]
aj wrote:
void rgb_to_hsv(int r, int g, int b, float *h, float *s, float *v) in /allegro419/src/color.cthe var named delta.. could that calc to zero and then cause a div-by-zero ?
I see you have grepped the source tree for '/' :-)No, this place is safe. If delta=0, then *s=0 so that branch would not be taken. Also, if delta!=0, then it is at least 1/255, so there is no risc that it is "very small".
sven
Mail converted by MHonArc 2.6.19+ | http://listengine.tuxfamily.org/ |