all repos — min @ b1c295ef49d4f62eaec5ad5fd62116fc104500c6

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

b1c295ef49d4f62eaec5ad5fd62116fc104500c6

parent

f27058c9068a661406f6a444a0c1ad27475e57dc

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