Skip to content

Commit

Permalink
NaN floatFormat with clang_cl (#12910)
Browse files Browse the repository at this point in the history
* clang_cl nan floatFormat

* format
  • Loading branch information
cooldome authored and Araq committed Dec 17, 2019
1 parent e8f4586 commit 7650617
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/system/formatfloat.nim
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ proc writeFloatToBuffer*(buf: var array[65, char]; value: BiggestFloat): int =
result = n + 2
else:
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.
# 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")
result = 3
elif buf[n-1] == 'F':
Expand Down

0 comments on commit 7650617

Please sign in to comment.