I don't know if they question is really "does it work", i think it's more like, "does it display correctly". Depending on what the sign was it could screw up the way it is displayed. For example:
1/2 / -3/4 = 4/-6 without any sign checking. You would not want to display a fraction like this. You would want:
1/2 / -3/4 = -4/6.
The reduction method also seemed to mess with the sign although I can't give you a case off the top of my head. I implemented a method to check the sign and fix it if necessary. It looks like this:
-(void) checkSign {
if ( denominator < 0 && numerator > 0) {
denominator *= -1;
numerator *= -1;
}
if (denominator < 0 && numerator < 0 ) {
denominator *= -1;
numerator *= -1;
}
}Jason