469,282 Members | 2,034 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,282 developers. It's quick & easy.

Help deciphering homework instructions...

TMS
119 100+
I have an instruction for a rational class that I am writing that I don't understand, and am hoping someone can clarify:

Implement overloaded methods for the +, -, *, ? and ** (with a presumed integer exponent) operators using what you know from integer arithmetic. (I get this part) For instance:

a/b + c/d = (ad + cb)/bd

Note that the rational numbers are 'closed' (this is what I don't understand) under these operations. Also note that rational arithmetic is exact.

Its just the last two sentences I don't understand. I included the rest for context. Overloaded methods are not a problem.

Thank you in advance

TMS
Feb 10 '07 #1
1 899
bvdet
2,851 Expert Mod 2GB
I have an instruction for a rational class that I am writing that I don't understand, and am hoping someone can clarify:

Implement overloaded methods for the +, -, *, ? and ** (with a presumed integer exponent) operators using what you know from integer arithmetic. (I get this part) For instance:

a/b + c/d = (ad + cb)/bd

Note that the rational numbers are 'closed' (this is what I don't understand) under these operations. Also note that rational arithmetic is exact.

Its just the last two sentences I don't understand. I included the rest for context. Overloaded methods are not a problem.

Thank you in advance

TMS
Under these operations (+, -, *, /), rational numbers are closed meaning the result is another rational number. Any number that can be exactly represented by a ratio of integers is rational.
Feb 11 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by Tinker | last post: by
11 posts views Thread by The_Kingpin | last post: by
6 posts views Thread by booksnore | last post: by
1 post views Thread by simonalexander | last post: by
12 posts views Thread by Progressus | last post: by
6 posts views Thread by darren112 | last post: by
12 posts views Thread by adamurbas | last post: by
20 posts views Thread by zerobinary | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.