Re: [q-lang-users] Unparse on Rationals
Brought to you by:
agraef
|
From: Albert G. <Dr....@t-...> - 2006-06-22 01:18:19
|
John Cowan wrote: > Rob Hubbard scripsit: > >>I wondered whether it would be preferable to present, for example: >> >> 3%1 as just 3 >> The LHS has the advantage of looking like the rational it is >> The RHS is clearly simpler No, I definitely have to oppose this. :) It should be clear to see that it is a rational number, so 3%1, not 3. For the same reason, a complex number is unparsed as X+Y*i even if Y is zero. (Currently I do simplify the case of a zero real part, though, in this case the number would be printed as just Y*i, but that also makes it clear that it's a complex number.) >> 11%5 as 2+1%5 >> The LHS is simpler this time >> The magnitude of the RHS more obvious (i.e. that it's "2 and a bit") > > I definitely prefer the LHS in this case, because 2+1%5+3+2%5*i is > completely misleading (or would it be parenthesized by the unparser?) Yes the LHS, again. If you need a better format to see the magnitude, well that's what ratutils::str_mixed is for. Albert -- Dr. Albert Gr"af Dept. of Music-Informatics, University of Mainz, Germany Email: Dr....@t-..., ag...@mu... WWW: http://www.musikinformatik.uni-mainz.de/ag |