3 ms·
And then there was Clojure... (defn average [numbers] (/ (apply + numbers) (count numbers))) (average [8.988465674311579e+307M, 8.98846567431158e+307M])
by wellpast 8y ago
And then there was Clojure...
(defn average [numbers] (/ (apply + numbers) (count numbers)))
(average [8.988465674311579e+307M, 8.98846567431158e+307M])
=> 8.9884656743115795E+307M
- bjoli 8y agoBut by then you are not comparing apples to apples. Those are Java BigFloats, and by that reasoning Java and any other language that has access to bigfloats also would do the correct thing.
- wellpast 8y agoBut still relevant, no? You could say that the “hard problem” mentioned has been removed by those abstractions.