printing float values will have one more digit. (#13276) [backport]
* printing float values will have one more digit. Fixes #13196
This commit is contained in:
parent
cdedb86348
commit
b2c6db97f9
10 changed files with 45 additions and 41 deletions
|
|
@ -1,7 +1,7 @@
|
|||
discard """
|
||||
output: '''108
|
||||
11 -1 1936
|
||||
0.4
|
||||
0.5
|
||||
true
|
||||
truefalse'''
|
||||
"""
|
||||
|
|
@ -75,7 +75,7 @@ proc evaluate(n: Formula, varToVal: proc (name: string): float): float =
|
|||
of fkMul: evaluate(n.left, varToVal) * evaluate(n.right, varToVal)
|
||||
of fkExp: pow(evaluate(n.left, varToVal), evaluate(n.right, varToVal))
|
||||
|
||||
echo evaluate(Formula(kind: fkLit, value: 0.4), nil)
|
||||
echo evaluate(Formula(kind: fkLit, value: 0.5), nil)
|
||||
|
||||
proc isPolyTerm(n: Formula): bool =
|
||||
n.kind == fkMul and n.left.kind == fkLit and (let e = n.right;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue