by rotifer · 2y ago · 0 comments
ghci> sum [i % (i+1) | i <- [0..9]]
17819 % 2520
ghci>
% is the constructor for Rational numbers. I.e. one half is written (and shown as) 1 % 2.I'll spare people the full result, but:
ghci> sum [i % (i+1) | i <- [0..999]]
70755...77483 % 71288...20000
ghci>No comments yet.