I am going through the exercism track. When doing the Space Age exercise, I get the correct result with some rounding errors, but because the tests check for exact equality, it doesn't pass. I know the exercise uses Dec instead of floating points, so it should be exact in theory, but different methods of finding the solution will still give different results.
Also the solution is rounded to two digits after the decimal point, but roc does not (yet) have a function to conveniently round to something other than integers. So I had to multiply by 100, round, and divide again which wasn't that nice of an experience
Seems like the easiest fix would be to change the test to check for a small difference with the target value instead of an exact match.
True, especially since Num.isApproxEq
exists anyway
@Kilian Vounckx could you make an issue on the exercism/roc repo?
Thanks!
Just opened a PR to update this https://github.com/exercism/roc/pull/80
Last updated: Jul 06 2025 at 12:14 UTC