From: John Darrington Date: Mon, 15 Sep 2008 03:17:52 +0000 (+0800) Subject: Use pow2 function instead of SQR macro. X-Git-Tag: v0.7.1~50^2~62 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d458c186c5395d900e9b3bc022abe4533fcc62df;p=pspp-builds.git Use pow2 function instead of SQR macro. Thanks to Ben Pfaff for this suggestion. --- diff --git a/src/language/stats/reliability.q b/src/language/stats/reliability.q index edacdf12..0222a3f3 100644 --- a/src/language/stats/reliability.q +++ b/src/language/stats/reliability.q @@ -640,10 +640,10 @@ reliability_statistics_model_split (struct tab_table *tbl, tab_float (tbl, 3, 8, TAB_RIGHT, g, 8, 3); tmp = (1.0 - r*r) * rel->sc[1].n_items * rel->sc[2].n_items / - SQR (rel->sc[0].n_items); + pow2 (rel->sc[0].n_items); - uly = sqrt( SQR (SQR (r)) + 4 * SQR (r) * tmp); - uly -= SQR (r); + uly = sqrt( pow4 (r) + 4 * pow2 (r) * tmp); + uly -= pow2 (r); uly /= 2 * tmp; tab_float (tbl, 3, 7, TAB_RIGHT, uly, 8, 3); diff --git a/src/libpspp/misc.h b/src/libpspp/misc.h index f3afb1fb..3b025157 100644 --- a/src/libpspp/misc.h +++ b/src/libpspp/misc.h @@ -35,8 +35,6 @@ /* Rounds X down to the previous multiple of Y. */ #define ROUND_DOWN(X, Y) ((X) / (Y) * (Y)) -#define SQR(X) ((X) * (X)) - int intlog10 (unsigned); /* Returns the square of X. */