3 ms·
Works in Racket (and should in other Schemes): -> (for/sum ([_ (in-range 10)]) (/ 1 10)) 1 Yeah, I know, I'm cheating - `(/ 1 10)` returns a rational? whi
by klibertp 13y ago
Works in Racket (and should in other Schemes):
-> (for/sum ([_ (in-range 10)]) (/ 1 10))
1
Yeah, I know, I'm cheating - `(/ 1 10)` returns a rational? which is not flonum?. Using `0.1` makes it inexact like it should be:
-> (for/sum ([_ (in-range 10)]) 0.1)
0.9999999999999999