The FL/math.h includes this implementation of copysign:
inline double copysign(double a, double b) {return b<0 ? -a : a;}
That looks wrong to me. I think we should only invert the sign of "a" if
it is different from the sign of "b". For example, with the current
code, if we pass a == -2 and b == -5 then we will return +2, which is
surely wrong?
Maybe something like this is better:
inline double copysign(double a, double b) {return b<0 ? (a<0 ? a :
-a) : (a<0 ? -a : a);}
This may all be moot anyway, since the fltk code doesn't seem to use
copysign anywhere, but I worry that it might break some code that uses
fltk.
I'd vote for removing this definition from our math.h entirely, if we do
indeed not use it, and let the end user resolve this themselves, if they
need it for portability reasons.
--
Ian
SELEX Sensors and Airborne Systems Limited
Registered Office: Sigma House, Christopher Martin Road, Basildon, Essex SS14
3EL
A company registered in England & Wales. Company no. 02426132
********************************************************************
This email and any attachments are confidential to the intended
recipient and may also be privileged. If you are not the intended
recipient please delete it from your system and notify the sender.
You should not copy it or use it for any purpose nor disclose or
distribute its contents to any other person.
********************************************************************
_______________________________________________
fltk-dev mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-dev