Skip to content

Commit

Permalink
vm: use the fmt library to fix shortest decimal representation is…
Browse files Browse the repository at this point in the history
…sue.

Before:

    IN: scratchpad 0x1.1ffffffffffffp7 .
    144.0

    IN: scratchpad 0x1.2p7 .
    144.0

    IN: scratchpad 0x1.2000000000001p7 .
    144.0

After:

    IN: scratchpad 0x1.1ffffffffffffp7 .
    143.99999999999997

    IN: scratchpad 0x1.2p7 .
    144.0

    IN: scratchpad 0x1.2000000000001p7 .
    144.00000000000003

Perhaps we should implement the Dragonbox algorithm ourselves at some point.
  • Loading branch information
mrjbq7 committed Feb 7, 2024
1 parent c4b5967 commit 4a58c56
Show file tree
Hide file tree
Showing 5 changed files with 9,211 additions and 16 deletions.
1 change: 1 addition & 0 deletions GNUmakefile
Expand Up @@ -74,6 +74,7 @@ ifdef CONFIG
vm/entry_points.o \
vm/errors.o \
vm/factor.o \
vm/format.o \
vm/full_collector.o \
vm/gc.o \
vm/image.o \
Expand Down

0 comments on commit 4a58c56

Please sign in to comment.