aboutsummaryrefslogtreecommitdiff
path: root/src/library.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/library.js')
-rw-r--r--src/library.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/library.js b/src/library.js
index 5779327f..2578fda4 100644
--- a/src/library.js
+++ b/src/library.js
@@ -5732,7 +5732,8 @@ LibraryManager.library = {
llround: 'round',
llroundf: 'round',
rint: function(x) {
- return (x > 0) ? -Math.round(-x) : Math.round(x);
+ if (Math.abs(x % 1) !== 0.5) return Math.round(x);
+ return x + x % 2 + ((x < 0) ? 1 : -1);
},
rintf: 'rint',
lrint: 'rint',