-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
infinity literal #7186
Comments
Comment author: pierpa As far as I understand, it's not the same issue. (string_of_float infinity) evaluates to "inf", which I don't think is dependent from locale. The same behaviour has been observed on windows and on linux |
Comment author: @dbuenzli Then I don't know, but I can't reproduce what you mention on either osx or Ubuntu 14.04 LTS 64 bits. |
Comment author: pierpa Actually, the confirmation on Linux was due to a misunderstanding. Currently, AFAIK, it's only present on windows. |
Comment author: @dbuenzli Search the bt for infinity there have been issues with this in the past. |
Comment author: @gasche Indeed, in #4688 David Allsopp contributed a patch to fix string_of_float on Windows (see the patch "v2" in the issue's Attached Files). If you proposed a patch using the same conditional logic to override the float_of_string behavior on "inf", "-inf" and "nan" in the Windows case, I think it would be a good idea. |
Comment author: pierpa I think that would be too much work just for exploring Ocaml a bit. let less_buggy_float_of_string s = |
Comment author: @mshinwell It seems there is nothing to do here. |
Original bug ID: 7186
Reporter: pierpa
Status: closed (set by @mshinwell on 2016-12-08T11:55:09Z)
Resolution: not a bug
Priority: normal
Severity: minor
Platform: Windows
OS: any
OS Version: any
Version: 4.01.0
Target version: 4.03.1+dev
Category: ~DO NOT USE (was: OCaml general)
Related to: #4688
Monitored by: braibant @dra27
Bug description
I expected the following to work, but it doesn't:
float_of_string (string_of_float infinity);;
Exception: Failure "float_of_string".
I need an infinity literal which is accepted by float_of_string.
The text was updated successfully, but these errors were encountered: