[Groonga-commit] droonga/fluent-plugin-droonga at 42f185a [master] Calculate average as a float

Back to archive index

YUKI Hiroshi null+****@clear*****
Mon Jan 27 12:04:44 JST 2014


YUKI Hiroshi	2014-01-27 12:04:44 +0900 (Mon, 27 Jan 2014)

  New Revision: 42f185a2ba67660494fd61f2d36a52d43f0a5149
  https://github.com/droonga/fluent-plugin-droonga/commit/42f185a2ba67660494fd61f2d36a52d43f0a5149

  Message:
    Calculate average as a float

  Modified files:
    lib/droonga/plugin/collector/basic.rb

  Modified: lib/droonga/plugin/collector/basic.rb (+1 -1)
===================================================================
--- lib/droonga/plugin/collector/basic.rb    2014-01-27 12:03:57 +0900 (c6fd839)
+++ lib/droonga/plugin/collector/basic.rb    2014-01-27 12:04:44 +0900 (eacd68f)
@@ -53,7 +53,7 @@ module Droonga
         reduced_value = apply_output_range(reduced_value,
                                            "limit" => deal["limit"])
       when "average"
-        reduced_value = (left_value + right_value) / 2
+        reduced_value = (left_value.to_f + right_value.to_f) / 2
       when "sort"
         reduced_value = merge(left_value,
                               right_value,
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index