diff options
author | Matthias Radestock <matthias@lshift.net> | 2010-01-27 13:00:30 +0000 |
---|---|---|
committer | Matthias Radestock <matthias@lshift.net> | 2010-01-27 13:00:30 +0000 |
commit | d57cbe5283dff29a0eccc19f72bde86e2f26c20e (patch) | |
tree | 7291d11a8c93c0d9b44bf0c45eaecad4bc39edb3 | |
parent | 40f3c9c8d24cb23230870ef32ca8087f55dbab2a (diff) | |
download | rabbitmq-server-d57cbe5283dff29a0eccc19f72bde86e2f26c20e.tar.gz |
fix embarrassing arithmetic bug in 'ceil'
0.0 doesn't case-match 0, but 0 == 0.0
-rw-r--r-- | src/rabbit_misc.erl | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/rabbit_misc.erl b/src/rabbit_misc.erl index 0866da3f..172e27f4 100644 --- a/src/rabbit_misc.erl +++ b/src/rabbit_misc.erl @@ -489,9 +489,9 @@ unfold(Fun, Acc, Init) -> ceil(N) -> T = trunc(N), - case N - T of - 0 -> N; - _ -> 1 + T + case N == T of + true -> T; + false -> 1 + T end. queue_fold(Fun, Init, Q) -> |