Hello.
I have to sort n fractions given their numerator(a1-an) and denominator(b1-bn).
My question is:
Is it risky to:
have a
1 2 3 4 5
struct fraction
{
int numerator,denominator;
longdouble division;
};
and store division=(longdouble)numerator/denominator;?
Beacause i want to test for equality i just wonder if the computer goes to the 1/2 fraction and gets 0.5 but when it goes to 2/4 it gets 0.4999999.. than htey wont be equal. What do you think?