The problem description of the “resister color trio” exercise says that the result should be given in ohms, kiloohms, megaohms, etc. One of the examples given in the description is:
orange-orange-red would be 33 and 2 zeros, which becomes 3300 ohms.
I am wondering what unit should I use in this case. The answer should be 3.3 kiloohms, 3300 ohms, or 3 kiloohms and 300 ohms? The test set contains no cases like this.
There was an attempt to add a test for that case. There was no consensus on what the correct output ought to be so it was left undefined and up to the implementation to choose :)
I know Emacs Lisp, Julia, and V have implemented that as 3.3 kiloohms instead of 3 kiloohms. There are 40+ tracks that implement the exercise though so there might be a few others as well. I don’t recall seeing tracks doing an expected value like “3 kiloohms and 300 ohms”. That doesn’t sound like natural English to me.
@IsaacG I felt that I might have seen some discussion on this topic before, but I could not find it.
@BNAndras I agree that “3 kiloohms and 300 ohms” is not a natural English expression. I just added it half kidding, but we say “3 m 20 cm”, don’t we?
I don’t mean to add anything to the exercise. But it seems odd that the problem description brings up 3300 ohms as an example and then completely ignores such possibility in talking about various resistance units. I thought that the original proposer(s) of the exercise may have some view on this point.
Yes, I can do it., or I think that we can alternatively add a paragraph at the end of the description:
When a resister’s bands are "orange", "orange", "red", the register value is expressed 3300 ohms or 3.3 kiloohms in real life. Which style is used varies from a language track to another. Please check your track’s tests carefully.