suztomoの日記

To be a good software engineer

IntegerやIntやfromInteger

いつも忘れる。

Prelude> (10000::Int) * 100000000 * 1000000
-1486618624
Prelude> (10000::Integer) * 100000000 * 1000000
1000000000000000000
Prelude> sqrt .fromIntegral $ 10
3.1622776601683795

http://en.wikibooks.org/wiki/File%3aClasses.png