Convert floating to fixed point by rounding, not truncation

Fixes #678
This commit is contained in:
Rangi
2021-01-04 10:49:30 -05:00
committed by Eldred Habert
parent 7e3fc1db03
commit 7ce5cf1595
6 changed files with 19 additions and 2 deletions

View File

@@ -0,0 +1,11 @@
f1 = 3.1
f2 = 5.2
pm = MUL(f1, f2)
pr = 16.12
println "`3.1`: {9.6f:f1} -> ${08x:f1}"
println "`5.2`: {9.6f:f2} -> ${08x:f2}"
println "`MUL`: {9.6f:pm} -> ${08x:pm}"
println "`16.12`: {9.6f:pr} -> ${08x:pr}"
fl = 6.283185
println "`6.283185`: {.6f:fl} -> ${08x:fl}"