Skip to content

Bignum: natural subtraction sometimes wrong

Consider

module Main (main) where

import Numeric.Natural

main :: IO ()
main = print (n - s)
  where
    n, s :: Natural
    n = 137503105969312982142385040956303729937425409769904987267247644890331944583201
    s = 370814112419299627365008243601943822482

Compiled with HEAD it prints 0.

Edited by Sylvain Henry
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information