为什么这打印负数 -147982099 而不是 8462696833 = 600851475143 / 71
import Data.List
smallFactor n = case (elemIndex 0 (map (mod n) [2..])) of
Just x -> x + 2
main = print( quot n (smallFactor n) )
where n = 600851475143
完整输出:
$ ghc --make p3; ./p3
[1 of 1] Compiling Main ( p3.hs, p3.o )
Linking p3 ...
-147982099