all repos — min @ b692f38da39749aaa1302b76817e7309e2aa7097

A small but practical concatenative programming language.

Removed deprecated math.round call.
h3rald h3rald@h3rald.com
Fri, 10 Jan 2020 20:14:43 +0100
commit

b692f38da39749aaa1302b76817e7309e2aa7097

parent

848b261d7e387c15d09341a94aaecf1d2dc9cc2d

1 files changed, 6 insertions(+), 2 deletions(-)

jump to
M lib/min_math.nimlib/min_math.nim

@@ -1,5 +1,7 @@

import - math + math, + strformat, + strutils import ../core/parser, ../core/value,

@@ -28,7 +30,9 @@ def.symbol("round") do (i: In):

let vals = i.expect("int", "num") let places = vals[0].intVal.int let n = vals[1].getFloat - i.push n.round(places).newVal + var res = "" + formatValue(res, n, "." & $places & "f") + i.push parseFloat(res).newVal def.symbol("e") do (i: In): i.push E.newVal