NaN floatFormat with clang_cl (#12910)

* clang_cl nan floatFormat

* format
This commit is contained in:
cooldome 2019-12-17 10:25:46 +00:00 • committed by Andreas Rumpf
commit 7650617448

View file

@ -44,10 +44,10 @@ proc writeFloatToBuffer*(buf: var array[65, char]; value: BiggestFloat): int =
result = n + 2 result = n + 2
else: else:
result = n result = n
# On Windows nice numbers like '1.#INF', '-1.#INF' or '1.#NAN' # On Windows nice numbers like '1.#INF', '-1.#INF' or '1.#NAN' or 'nan(ind)'
# of '-1.#IND' are produced. # of '-1.#IND' are produced.
# We want to get rid of these here: # We want to get rid of these here:
if buf[n-1] in {'n', 'N', 'D', 'd'}: if buf[n-1] in {'n', 'N', 'D', 'd', ')'}:
writeToBuffer(buf, "nan") writeToBuffer(buf, "nan")
result = 3 result = 3
elif buf[n-1] == 'F': elif buf[n-1] == 'F':