[Forensics-changes] [yara] 303/407: Move from mean_err() to just mean().

Hilko Bengen bengen at moszumanska.debian.org
Sat Jul 1 10:28:39 UTC 2017


This is an automated email from the git hooks/post-receive script.

bengen pushed a commit to annotated tag v3.3.0
in repository yara.

commit 6e1f6ca0458f61304ed931dd33ab410499e7c492
Author: Wesley Shields <wxs at atarininja.org>
Date:   Sat Jan 3 15:40:34 2015 -0500

    Move from mean_err() to just mean().
---
 libyara/modules/math.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/libyara/modules/math.c b/libyara/modules/math.c
index 2eee2e5..141f397 100644
--- a/libyara/modules/math.c
+++ b/libyara/modules/math.c
@@ -220,7 +220,7 @@ define_function(data_mean_deviation)
 }
 
 
-define_function(string_mean_err)
+define_function(string_mean)
 {
   int i;
   double sum = 0.0;
@@ -235,12 +235,11 @@ define_function(string_mean_err)
     sum += (double) s->c_string[i];
 
 
-  sum = sum / (double) s->length;
-  return_double(fabs((sum - mean) / mean));
+  return_double(sum / (double) s->length);
 }
 
 
-define_function(data_mean_err)
+define_function(data_mean)
 {
   int i;
   double sum = 0.0;
@@ -296,8 +295,7 @@ define_function(data_mean_err)
   if (!past_first_block)
     return_double(UNDEFINED);
 
-  sum = sum / (double) total_len;
-  return_double(fabs((sum - mean) / mean));
+  return_double(sum / (double) total_len);
 }
 
 
@@ -536,8 +534,8 @@ begin_declarations;
   declare_double("MEAN_BYTES");
   declare_function("mean_deviation", "iid", "d", data_mean_deviation);
   declare_function("mean_deviation", "sd", "d", string_mean_deviation);
-  declare_function("mean_err", "iid", "d", data_mean_err);
-  declare_function("mean_err", "sd", "d", string_mean_err);
+  declare_function("mean", "ii", "d", data_mean);
+  declare_function("mean", "s", "d", string_mean);
   declare_function("serial_correlation", "ii", "d", data_serial_correlation);
   declare_function("serial_correlation", "s", "d", string_serial_correlation);
   declare_function("monte_carlo_pi", "ii", "d", data_monte_carlo_pi);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/forensics/yara.git



More information about the forensics-changes mailing list