-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Description
Original bug ID: 4245
Reporter: @mmottl
Assigned to: @xavierleroy
Status: closed (set by @xavierleroy on 2011-05-29T10:14:02Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 3.09.3
Fixed in version: 3.12.0+dev
Category: ~DO NOT USE (was: OCaml general)
Duplicate of: #4210
Related to: #3302
Monitored by: yminsky @mmottl
Bug description
This should not be accepted:
Int32.of_string "2147483648";;
- : int32 = -2147483648l
This is correctly rejected (first number + 1):
Int32.of_string "2147483649";;
Exception: Failure "int_of_string".
And this is correctly accepted (first number - 1):
Int32.of_string "2147483647";;
- : int32 = 2147483647l
The corner case is obviously not handled correctly.
The same problem happens with the other integer conversions: Int64.of_string, Nativeint.of_string, and even int_of_string.
Reactions are currently unavailable