Still on the percentage "unit" behaviour, and extending this to other multipliers, I still have some trouble using them.
In my head, I see % as being somehow similar to Kilo or Mega. But it seems that Mathematica treats it differently.
For instance, the following seems very wrong:
While this has a correct treatment:
But other inconsistencies remain common to these multiples or fractions "units". The following behaves badly:
But so does this one:
And the same doesn't happen, for instance, while subtracting meters.
Also interesting to notice that multiplying between the same "multiplier" units, makes them vanish:
(...so are they really to be seen as Units? The percentage "units" on my original post didn't vanish. I'm really confused...)
And interesting to notice that, while on the above they seem to be treated as multipliers (for instance, we don't get mega squared), we can't multiply between different ones:
(the error message is interesting)
And even more interesting is the fact that if we add a "first class" unit on the above example, we do get something:
(I talked to early... we can get a mega squared! Extremely bizarre)
So, some questions:
- are these known bugs and limitations?
- what is the language design philosophy concerning these multipliers?
- are there practical ways to deal with them? To have the control on making all disappear, or transforming all multipliers to a specified one, or to keep them all, etc.?
- (...I haven't explored the problems that can be brought by crossing the above with "compound" units, like Kilograms, but I guess that this "squares" the problem...)
Every time I try to use Units, I always get blocked with these problems. Am I the only one? I mean, we can use units (besides the bugs) for personal calculations, and although sometimes confusing, we can help in someway to check for coherence. But for me, the most interesting thing brought by units is the "auto" documentation of the code. We can simply show the code to someone else, and, thanks to units, it gets understood much faster. But with all these idiosyncrasies (and the corrections that I'm forced to add to the code to correct them), really makes it less readable, and not of good publicity to the language...