Add multipass procedures. Add two-pass moments calculation. Rewrite
[pspp] / src / misc.h
index 0f03b6df2df9dba6a9779efced19e12d3728b991..26b9a52639b3cafb7088e3c9690f132cc65cb99d 100644 (file)
 
 int intlog10 (unsigned);
 
+/* Returns the square of X. */
+static inline double
+pow2 (double x) 
+{
+  return x * x;
+}
+
+/* Returns the cube of X. */
+static inline double
+pow3 (double x) 
+{
+  return x * x * x;
+}
+
+/* Returns the fourth power of X. */
+static inline double
+pow4 (double x) 
+{
+  double y = x * x;
+  y *= y;
+  return y;
+}
+
 #endif /* math/misc.h */