Mercury Bugs - mercury
View Issue Details
0000373mercuryBugpublic2015-01-13 17:402016-02-24 09:44
Reporterwangp 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusnewResolutionopen 
PlatformOSOS Version
Product Version 
Target Version15.11Fixed in Version 
Summary0000373: string.to_float imprecisely specified
Descriptionstring.to_float does not explicitly describe the literals that it will accept, and may be backend dependent. As it is, it goes beyond Mercury float literals and that accepted by parsing_utils.float_literal_as_string.

Examples:

"1" (missing fractional part and exponent)
"+1" (leading plus)
".1" (leading dot)
"1."
"1.e"
"1e"
TagsNo tags attached.
Attached Files

Notes
(0000803)
juliensf   
2015-01-13 18:12   
There is no "may" about it. It *is* backend dependent.
(0000883)
juliensf   
2016-02-24 09:44   
A fix for this issue should also address the question of whether string.to_float("-0") is equal to 0.0 or -0.0?
The C back-ends** and C#/Java back-ends currently disagree on this.

** at least on OS X, with clang and BSD libc etc.

Issue History
2015-01-13 17:40wangpNew Issue
2015-01-13 18:12juliensfNote Added: 0000803
2015-10-29 14:47pboneTarget Version => 15.11
2016-02-24 09:44juliensfNote Added: 0000883