2010-09-15, 09:02 PM
ok, I see that. and it looks like it should work to me, but its still returning -1 all but the 3rd case. I did some fiddling and when i changed the
if (q > p) return -1;
to
if (q > p) return 0;
it returns 0, 0, 1, -1, 0.
for some reason, with both our codes it always returns -1 if the numbers are the same number of digits.
if (q > p) return -1;
to
if (q > p) return 0;
it returns 0, 0, 1, -1, 0.
for some reason, with both our codes it always returns -1 if the numbers are the same number of digits.

