Revert "printing float values will have one more digit. (#13276) [backport]" (#13363)

This reverts commit b2c6db97f9.
This commit is contained in:
Timothee Cour 2020-02-08 00:30:24 -08:00 • committed by GitHub
commit e4415422fe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 41 additions and 45 deletions

View file

@ -1,7 +1,7 @@
discard """
output: '''108
11 -1 1936
0.5
0.4
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.5), nil)
echo evaluate(Formula(kind: fkLit, value: 0.4), nil)
proc isPolyTerm(n: Formula): bool =
n.kind == fkMul and n.left.kind == fkLit and (let e = n.right;