I guess you didn't consider decimal numbers though. 1234454.846455 for example?
LMAO ok stop flexing
Ruby 3.0 should be enabled.
Codeblocks in the description should be language specific.
Was this ever resolved? I'm getting the exact same thing.
Oops. Forgot to check back here.
Ah. Right. Oh that's tricky...
It is also wrong for trailing 0s: 100 -> 1m
So uhm. I feel bad sticking my own solution in there. I can't swear it's right.
With the current one being obviously wrong, I did decide to do it though.
I also added tests where there's more than three digits on the left of the decimal point, along with numbers that had more than just 4 random digits in them.
Maybe going >= 1000Ym isn't appropriate, idk.
I fixed the random tests to properly use QuickCheck, so I got useful feedback on failure.
Falsifiable (after 21 tests):
12 expected "8.24Pm" but got "8.024Pm"
The reference solution really is incorrect. The input in this case was 8024e12 ( mantissa 8024, exponent 12 ); clearly the answer should not be 8.24 * 10 ^ something.
8.24 * 10 ^ something
Note that GHC version is 8.8.4 already, so I'm taking it off the to-be-updated-list.
I gave it a small poking at. I didn't change the reference solution (it appears to match my solution), but I did fix an incorrect fixed test.
Is it somewhat acceptable now? If not, please send me back in there with a hint about what else needs doing ._.
In description it says "See http://en.wikipedia.org/wiki/SI_prefix for a full list of prefixes" and "For this exercise we just want units bigger than a meter, from meters up to yottameters, excluding decameters and hectometers."
It was clear to me.
hahahhahah I'm still learning and when I saw your solution I said hellllll I'm smart :D just kidding broo but try to keep it easy
The units that are used should be specified either in the description or the sample tests; users should not need to hit 'attempt' in order to know what to do.
One way to fix this is to rewrite the whole test suite (it's bad as already stated below) and copy the existing tests into the sample test cases.
JS at least needs random tests.
needs random tests.
HAHAHA. You are funny (;