Re: [q-lang-users] Exponentiation operator
Brought to you by:
agraef
From: Rob H. <hub...@gm...> - 2006-06-16 20:42:32
|
John Cowan wrote: > Albert Graef scripsit: > >> A related question is whether rational arithmetic should return an Int >> instead of a Rational when the denominator of the result is 1. >> > > I think it should, yes. And likewise when the numerator is 0. > The Rationals are normalised (that is, they are reduced to have a positive denominator, and coprime numerator and denominator). So, when the numerator is 0, the denominator is 1. Thus the denominator is 1 exactly when the overall value is integral. |