Fork me on GitHub
#testing
<
2022-03-29
>
Alys Brooks00:03:48

I'm looking to port some statistical code from ClojureScript to Clojure, and I'm wondering if there are any techniques for validating that the calculations return the same results running on the JVM as they do in the JavaScript runtime. I don't think the math is wrong per se, just that rounding or other representational differences might lead to slightly different numbers. Probably what I will do is write some unit tests that test both versions of the function, but I'm wondering if there's a better way.

pithyless21:04:57

You might want to take a look at https://github.com/quoll/cljs-math - since Paula worked on figuring how to port (and test) the clojure.math namespace from CLJ to CLJS.

pithyless21:04:08

@U01FJUDL57C - I just realized I'm replying to a 4 days old thread. :)

Alys Brooks15:04:28

Thanks for the suggestion! I'll take a look. (And inadvertently, I waited 4 days to respond.)