Skip to content
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

inconsistent behavior of float_of_string (compare to "ints"_of_string) #6296

vicuna opened this issue Jan 18, 2014 · 3 comments

inconsistent behavior of float_of_string (compare to "ints"_of_string) #6296

vicuna opened this issue Jan 18, 2014 · 3 comments


Copy link

@vicuna vicuna commented Jan 18, 2014

Original bug ID: 6296
Reporter: @hhugo
Status: closed (set by @xavierleroy on 2017-09-24T15:32:15Z)
Resolution: fixed
Priority: normal
Severity: tweak
Target version: 4.03.0+dev / +beta1
Fixed in version: 4.03.0+dev / +beta1
Category: documentation
Related to: #4323 #5829 #6649 #6701
Monitored by: braibant

Bug description

float_of_string does not understand the octal string representation where other conversion functions do.
float_of_string "0o123" -> fail
(int_/Int64./Int32.)of_string "0o132" -> work

need to document the behavior or to fix it.

also I just discovered (reading strtod manpage) the syntax "0x1p8".

would need either documentation of accepted formats (like is it done with int conversion) or link to documentation of underlying c function

related to #5829

Copy link

@vicuna vicuna commented Jul 16, 2014

Comment author: @damiendoligez

I find it strange to expect float_of_string to understand octal integer format.

Still, documenting the accepted formats would be good.

Copy link

@vicuna vicuna commented Dec 8, 2014

Comment author: @hhugo

related to ocaml-community/yojson#13

Copy link

@vicuna vicuna commented Dec 5, 2015

Comment author: @xavierleroy

Added some documentation for float_of_string, commit [trunk 4d478a0].

Hexadecimal floating-point notation is now officially supported starting with 4.03.

We will not support octal notation. (Nobody does, and octal is a survivance of the past.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

No branches or pull requests

1 participant