Created
July 16, 2013 18:38
-
-
Save clockfort/6011388 to your computer and use it in GitHub Desktop.
show gambogi powers in haskell and their relative speed in square case
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Prelude> sum $ map (\n -> n*n) [1..1024*1024*10] | |
384307223177865461760 | |
it :: Integer | |
(5.20 secs, 3756611120 bytes) | |
Prelude> sum $ map (\n -> n**2) [1..1024*1024*10] | |
3.843072231783101e20 | |
it :: Double | |
(5.65 secs, 3960924248 bytes) | |
Prelude> sum $ map (\n -> n^2) [1..1024*1024*10] | |
384307223177865461760 | |
it :: Integer | |
(10.70 secs, 9549744736 bytes) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment