Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let toInt (b : bignum) : int option =
- if less b (fromInt Int.min_value) || greater b (fromInt Int.max_value)
- then None
- else
- let n = List.fold_left ~f:(fun c i -> c * 10 + i) b.coeffs ~init:0
- in Some (if b.neg then (-n) else n)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement