Fix precison of fixed-point formatting

Fixes #908
This commit is contained in:
Rangi
2021-10-27 20:24:54 -04:00
committed by Eldred Habert
parent 646fc62b89
commit b002d95459
4 changed files with 13 additions and 17 deletions

View File

@@ -9,3 +9,6 @@ pr = 16.12
fl = 6.283185
println "`6.283185`: {.6f:fl} -> ${08x:fl}"
fr = MUL(20.0, 0.32)
println "32% of 20 = {f:fr} (~{.2f:fr}) (~~{.0f:fr})"

View File

@@ -1,5 +1,6 @@
`3.1`: 3.100007 -> $0003199a
`3.1`: 3.100006 -> $0003199a
`5.2`: 5.199997 -> $00053333
`MUL`: 16.120026 -> $00101eba
`16.12`: 16.119996 -> $00101eb8
`16.12`: 16.119995 -> $00101eb8
`6.283185`: 6.283188 -> $0006487f
32% of 20 = 6.40015 (~6.40) (~~6)

View File

@@ -1,5 +1,5 @@
< 300 > <+00300> < 12c> < %100101100>
<4294967254> <-42> <&000037777777726>
<3.14159> <-00123> <-123.0455932618>
<3.14159> <-00123> <-123.0455932617>
<hello > < hello>
<300 >