Can I count on -0 ?
in
Programming Questions
•
3 years ago
I am doing the slope equation of a straight line and there are of course 2 special cases involved where the line is vertical and and where the line is horizontal. When the line is
horizontal Vertical I was trying to figure out a proper return would be to trigger handling this special case.
I don't really know what the return of Infinity represents,is it a generic Java return or Processing specific?
I would like to keep the function as platform generic as possible.
In the special cause where the denominator is 0 if I can return -0 and let that represent the special case of a horizontal line. Will this also work in C?
2