You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 581 Reporter: administrator Status: closed Resolution: fixed Priority: normal Severity: minor Category: ~DO NOT USE (was: OCaml general)
Bug description
Suggestion: float_of_string that throws exception if the number isn't a
float (as int_of_string does).
"The result is undefined if the given string is not a float"
doesn't go well with the concept of a language that helps
the programmer.
The current float_of_string could be renamed to
unsafe_float_of_string.
/mattias
The text was updated successfully, but these errors were encountered:
Suggestion: float_of_string that throws exception if the number isn't a
float (as int_of_string does).
"The result is undefined if the given string is not a float"
doesn't go well with the concept of a language that helps
the programmer.
OK, I grant you that. Turns out that we were using the atof() C
library function, which doesn't detect bad numbers, but ANSI C
specifies a better strtod() function that detects bad numbers. Since
it's ANSI, there's no portability problem. I'll patch the runtime
system to use strtod().
Original bug ID: 581
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)
Bug description
Suggestion: float_of_string that throws exception if the number isn't a
float (as int_of_string does).
"The result is undefined if the given string is not a float"
doesn't go well with the concept of a language that helps
the programmer.
The current float_of_string could be renamed to
unsafe_float_of_string.
/mattias
The text was updated successfully, but these errors were encountered: