Discussion:
Rational (0, 5) => 0/1 ?
(too old to reply)
Nahid
2005-01-18 23:04:33 UTC
Permalink
"The gcd of n and 0 for any non-zero integer n is n"

" The constructor Rational takes two int arguments and initializes the
fields to the corresponding values which hae a gcd of one"

So, if we have something like:
Rational s = new Rational (0,5)
are we supposed to store that as 0/1?

thnx!
Nahid
Douglas Harder
2005-01-19 13:58:49 UTC
Permalink
Correct.

Douglas
Post by Nahid
"The gcd of n and 0 for any non-zero integer n is n"
" The constructor Rational takes two int arguments and initializes the
fields to the corresponding values which hae a gcd of one"
Rational s = new Rational (0,5)
are we supposed to store that as 0/1?
thnx!
Nahid
Loading...