Closed ErikSchierboom closed 6 months ago
Currently, the tests fail:
age on Mars ... FAIL Actual: «35.88» Expected: «35.88» age on Jupiter ... FAIL Actual: «2.41» Expected: «2.41»
Clearly this floating point comparison shenanigans.
I can fix this is test by changing the number check to:
test
number? if 0.01 n:~= ;then
However, I'd rather not hardcode it. Should we add a new assertion? And if so, what would we name it?
Now about eps_equal? or approx_equal?
eps_equal?
approx_equal?
"age on Mars" ( 2129871239 "Mars" >age ) 35.88 0.01 approx_equal?
I've opened a PR to add an approx_equal? word.
Currently, the tests fail:
Clearly this floating point comparison shenanigans.
I can fix this is
test
by changing the number check to:However, I'd rather not hardcode it. Should we add a new assertion? And if so, what would we name it?