// -*- c -*-
//
// PSPP - a program for statistical analysis.
-// Copyright (C) 2005, 2006, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
+// Copyright (C) 2005, 2006, 2009, 2010, 2011, 2012, 2015, 2016 Free Software Foundation, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
function LN (x) = check_errno (log (x));
function LNGAMMA (x >= 0) = gsl_sf_lngamma (x);
function MOD10 (x) = fmod (x, 10);
-function RND (x) = x >= 0. ? floor (x + .5) : -floor (-x + .5);
+function RND (x) = round_nearest (x, 1, 0);
+function RND (x, mult != 0) = round_nearest (x, mult, 0);
+function RND (x, mult != 0, fuzzbits >= 0) = round_nearest (x, mult, fuzzbits);
function SIN (x) = sin (x);
function SQRT (x >= 0) = sqrt (x);
function TAN (x) = check_errno (tan (x));
return mean;
}
+function MEDIAN.1 (a[n])
+{
+ return median (a, n);
+}
+
function MIN.1 (a[n])
{
double min;
}
}
-
function RINDEX (string haystack, string needle)
{
if (needle.length == 0)
function RINDEX (string haystack, string needles, needle_len_d)
{
- if (needle_len_d <= INT_MIN || needle_len_d >= INT_MAX
+ if (needle_len_d <= 0 || needle_len_d >= INT_MAX
|| (int) needle_len_d != needle_len_d
|| needles.length == 0)
return SYSMIS;
}
}
+string function REPLACE (string haystack, string needle, string replacement)
+ expression e;
+ = replace_string (e, haystack, needle, replacement, DBL_MAX);
+
+absorb_miss string function REPLACE (string haystack, string needle,
+ string replacement, n)
+ expression e;
+ = replace_string (e, haystack, needle, replacement, n);
+
absorb_miss string function RPAD (string s, n)
expression e;
{