Skip to content

Commit

Permalink
use dragonbox algorithm; alternative to #18008 (#18139)
Browse files Browse the repository at this point in the history
* use dragonbox algorithm; alternative to #18008
* removed unsafe code
  • Loading branch information
Araq authored Jun 1, 2021
1 parent ba3ec7b commit 63db2b1
Show file tree
Hide file tree
Showing 5 changed files with 1,408 additions and 50 deletions.
4 changes: 4 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@
- `json` and `jsonutils` now serialize NaN, Inf, -Inf as strings, so that
`%[NaN, -Inf]` is the string `["nan","-inf"]` instead of `[nan,-inf]` which was invalid json.

- `system.addFloat` now uses the "Dragonbox" algorithm, which ensures correct roundtrips of floating point
numbers, that the minimum length representation of a floating point number is used and correct rounding.
Use `-d:nimLegacyAddFloat` for a transition period.

- `strformat` is now part of `include std/prelude`.

- Deprecated `proc reversed*[T](a: openArray[T], first: Natural, last: int): seq[T]` in `std/algorithm`.
Expand Down
2 changes: 2 additions & 0 deletions compiler/condsyms.nim
Original file line number Diff line number Diff line change
Expand Up @@ -134,3 +134,5 @@ proc initDefines*(symbols: StringTableRef) =
defineSymbol("nimHasUnifiedTuple")
defineSymbol("nimHasIterable")
defineSymbol("nimHasTypeofVoid")

defineSymbol("nimHasDragonBox")
Loading

0 comments on commit 63db2b1

Please sign in to comment.