You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here, large Dec numbers are divided and while the solution works in the repl and on exercism's hardware, it fails when compiled with roc test. The Neptune result is way off. I guess it compiles to some lower resolution type under the hood on ARM.
This is the code for the solution:
module [age]
Planet : [
Mercury,
Venus,
Earth,
Mars,
Jupiter,
Saturn,
Uranus,
Neptune,
]
ratio : Planet -> Dec
ratio = \planet -> when planet is
Mercury -> 0.2408467
Venus -> 0.61519726
Earth -> 1.0
Mars -> 1.8808158
Jupiter -> 11.862615
Saturn -> 29.447498
Uranus -> 84.016846
Neptune -> 164.79132
secondsPerEarthYear : Dec
secondsPerEarthYear = 315.57600
age : Planet, Dec -> Dec
age = \planet, seconds ->
seconds / 100000 / secondsPerEarthYear / (ratio planet)
And the test that fails:
app [main] {
pf: platform "https://github.com/roc-lang/basic-cli/releases/download/0.17.0/lZFLstMUCUvd5bjnnpYromZJXkQUrdhbva4xdBInicE.tar.br",
}
main =
Task.ok {}
# ...
import SpaceAge exposing [age]
# age on Neptune
expect
result = age Neptune 1821023456
Num.isApproxEq result 0.35 { atol: 0.01 }
The text was updated successfully, but these errors were encountered:
I am doing exercism exercises for roc on my CM4-based uConsole. It has been working great until the one named Space Age https://exercism.org/tracks/roc/exercises/space-age
Here, large Dec numbers are divided and while the solution works in the repl and on exercism's hardware, it fails when compiled with
roc test
. The Neptune result is way off. I guess it compiles to some lower resolution type under the hood on ARM.This is the code for the solution:
And the test that fails:
The text was updated successfully, but these errors were encountered: