aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_bif_guard.c
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2017-02-16 15:47:45 +0100
committerSverker Eriksson <[email protected]>2017-02-16 15:47:45 +0100
commitfa8090d2d34e3755265192da09b588b966fd1158 (patch)
tree91921a994d49c963950ea8244b2ce5d2ec4799ab /erts/emulator/beam/erl_bif_guard.c
parentdbf3754567fdc97a53da529e04400602c647ee7e (diff)
parentb10b410fd37f960d4842b35bd51ea0fb0506a186 (diff)
downloadotp-fa8090d2d34e3755265192da09b588b966fd1158.tar.gz
otp-fa8090d2d34e3755265192da09b588b966fd1158.tar.bz2
otp-fa8090d2d34e3755265192da09b588b966fd1158.zip
Merge branch 'maint' into 'master'
Diffstat (limited to 'erts/emulator/beam/erl_bif_guard.c')
-rw-r--r--erts/emulator/beam/erl_bif_guard.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/erts/emulator/beam/erl_bif_guard.c b/erts/emulator/beam/erl_bif_guard.c
index 458315f293..cdac4c1d11 100644
--- a/erts/emulator/beam/erl_bif_guard.c
+++ b/erts/emulator/beam/erl_bif_guard.c
@@ -190,7 +190,7 @@ BIF_RETTYPE round_1(BIF_ALIST_1)
GET_DOUBLE(BIF_ARG_1, f);
/* round it and return the resultant integer */
- res = double_to_integer(BIF_P, (f.fd > 0.0) ? f.fd + 0.5 : f.fd - 0.5);
+ res = double_to_integer(BIF_P, round(f.fd));
BIF_RET(res);
}
@@ -630,8 +630,7 @@ Eterm erts_gc_round_1(Process* p, Eterm* reg, Uint live)
}
GET_DOUBLE(arg, f);
- return gc_double_to_integer(p, (f.fd > 0.0) ? f.fd + 0.5 : f.fd - 0.5,
- reg, live);
+ return gc_double_to_integer(p, round(f.fd), reg, live);
}
Eterm erts_gc_trunc_1(Process* p, Eterm* reg, Uint live)