FAILED
Test 9
Calculates the diameter of a pizza from the amount of sauce applied (4/5)
CODE RUN
(is (= 32.573500793528d0 (size-from-sauce 250)))
(is (= 20.601290774570113d0 (size-from-sauce 100)))
(is (= 37.424103185095554d0 (size-from-sauce 330)))
(is (= 46.52426491681278d0 (size-from-sauce 510)))
(is (= 53.72159374714264d0 (size-from-sauce 680)))
TEST FAILURE
(SIZE-FROM-SAUCE 100)
evaluated to
20.60129077457011d0
which is not
=
to
20.601290774570113d0
Not sure right now, I submitted my solution again to check if itās still passing and it passed.
Can you please share your code?
This is off topic but since you wrote in another thread that you had a difficult time getting into lispā¦ I would have a hard time getting into Lisp as well if I would try it without good editor support and a REPL. And I already had a hard time getting into Lisp when I started out.
Feel free to hit me up on slack if you need help with setting up an environment.
Since youāre an experienced Exercism user I assume you know but maybe someone else comes across this post and doesnāt know: You can download the exercise and submit a failing solution through the CLI. That way you can ask for mentorship.
Yeah, youāre running into a type conversion issue. My theory was that itās a problem with defining the sauce-unit as a fraction but converting it to a float didnāt help.
+1 for not matching floating point numbers to the 15th decimal. I learned that you should always only match up to a certain precision when testing floating-point numbers.
If you transfer the formula like itās written in the problem description, without transforming it, your test should pass: square-root of ((40 * sauce-applied) / (3 * pi))
@glennj the fix to the exercise was merged so hopefully you should be seeing it on the web site. Has it fixed the problem? Can we mark this topic āsolvedā?