summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2017-01-10 18:29:26 +0100
committerAndreas Rumpf <rumpf_a@web.de>2017-01-10 18:29:26 +0100
commit6ee487b0eb88a21e6457b1750e0f8d829b971d17 (patch)
treeb5db4e0c8afbf5b56a5e5a02257cc59961dd1241 /compiler
parentaceb2e1bdfd90ee894d62ea3983e08c8fb771c06 (diff)
downloadNim-6ee487b0eb88a21e6457b1750e0f8d829b971d17.tar.gz
bugfix: abs(0.0) should be +0.0
Diffstat (limited to 'compiler')
-rw-r--r--compiler/ccgexprs.nim2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/ccgexprs.nim b/compiler/ccgexprs.nim
index ba4c6f485..58c0d745c 100644
--- a/compiler/ccgexprs.nim
+++ b/compiler/ccgexprs.nim
@@ -610,7 +610,7 @@ proc unaryArith(p: BProc, e: PNode, d: var TLoc, op: TMagic) =
       "($3)((NU$2) ~($1))",   # BitnotI
       "$1",                   # UnaryPlusF64
       "-($1)",                # UnaryMinusF64
-      "($1 > 0? ($1) : -($1))", # AbsF64; BUGFIX: fabs() makes problems
+      "($1 < 0? -($1) : ($1))", # AbsF64; BUGFIX: fabs() makes problems
                                 # for Tiny C, so we don't use it
       "(($3)(NU)(NU8)($1))",  # mZe8ToI
       "(($3)(NU64)(NU8)($1))", # mZe8ToI64