Fixes #5821 (float32 literal comparison issue) (#5825)

* Remove processing hints for async procs.
* Fixes #5821.
This commit is contained in:
Dominik Picheta 2017-05-17 14:57:06 +01:00 • committed by Andreas Rumpf
commit 06415eb69d
4 changed files with 19 additions and 7 deletions

View file

@ -12,17 +12,17 @@ import strutils
proc c_sprintf(buf, frmt: cstring) {.importc: "sprintf", header: "<stdio.h>", nodecl, varargs.}
proc toStrMaxPrecision*(f: BiggestFloat): string =
proc toStrMaxPrecision*(f: BiggestFloat, literalPostfix = ""): string =
if f != f:
result = "NAN"
elif f == 0.0:
result = "0.0"
result = "0.0" & literalPostfix
elif f == 0.5 * f:
if f > 0.0: result = "INF"
else: result = "-INF"
else:
var buf: array[0..80, char]
c_sprintf(buf, "%#.16e", f)
c_sprintf(buf, "%#.16e" & literalPostfix, f)
result = $buf
proc encodeStr*(s: string, result: var string) =