Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
int_of_string fails on integers starting with a + #6649
Original bug ID: 6649
The documentation states:
"Raise Failure "int_of_string" if the given string is not a valid representation of an integer, or if the integer represented exceeds the range of integers representable in type int."
But starting an integer with a + is valid:
let x = +1;;
val x : int = 1
Steps to reproduce
Exception: Failure "int_of_string".
Scanf.sscanf "%d" accepts the +