X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=doc%2Fexpressions.texi;h=1141f3a53d723f0aba39d03b165447a961fd3d63;hb=a893ad180353823f3e123cd268d98026e5a31ed7;hp=b7e23a5f96c3d0721a4614832a09292a47bd67e9;hpb=32dc29d70ac55ad3629053097b83c74bb0068fc0;p=pspp diff --git a/doc/expressions.texi b/doc/expressions.texi index b7e23a5f96..1141f3a53d 100644 --- a/doc/expressions.texi +++ b/doc/expressions.texi @@ -1,7 +1,7 @@ @c Use @func when refering to a function. @c Use @deftypefn for their definitions @macro func{NAME} -@code{/NAME/} +@code{\NAME\} @end macro @node Expressions @@ -262,9 +262,10 @@ The sections below describe each function in detail. * Trigonometry:: ACOS ARCOS ARSIN ARTAN ASIN ATAN COS SIN TAN * Missing Value Functions:: MISSING NMISS NVALID SYSMIS VALUE * Set Membership:: ANY RANGE -* Statistical Functions:: CFVAR MAX MEAN MIN SD SUM VARIANCE +* Statistical Functions:: CFVAR MAX MEAN MEDIAN MIN SD SUM VARIANCE * String Functions:: CONCAT INDEX LENGTH LOWER LPAD LTRIM NUMBER - REPLACE RINDEX RPAD RTRIM STRING SUBSTR UPCASE + REPLACE RINDEX RPAD RTRIM STRING STRUNC SUBSTR + UPCASE * Time and Date:: CTIME.xxx DATE.xxx TIME.xxx XDATE.xxx DATEDIFF DATESUM * Miscellaneous Functions:: LAG YRMODA VALUELABEL @@ -341,9 +342,14 @@ FUZZBITS}), which is 6 unless overridden. @end deftypefn @cindex truncation -@deftypefn {Function} {} TRUNC (@var{number}) -Discards the fractional part of @var{number}; that is, rounds -@var{number} towards zero. +@deftypefn {Function} {} TRUNC (@var{number} [, @var{mult}[, @var{fuzzbits}]]) +Rounds @var{number} to a multiple of @var{mult}, toward zero. For the +default @var{mult} of 1, this is equivalent to discarding the +fractional part of @var{number}. Values that fall short of a multiple +of @var{mult} by less than @var{fuzzbits} of errors in the +least-significant bits of @var{number} are rounded away from zero. If +@var{fuzzbits} is not specified then the default is taken from SET +FUZZBITS (@pxref{SET FUZZBITS}), which is 6 unless overridden. @end deftypefn @node Trigonometry @@ -510,6 +516,13 @@ be numeric or string. Results in the mean of the values of @var{number}. @end deftypefn +@cindex median +@deftypefn {Function} {} MEDIAN (@var{number}, @var{number}[, @dots{}]) +Results in the median of the values of @var{number}. Given an even +number of nonmissing arguments, yields the mean of the two middle +values. +@end deftypefn + @cindex minimum @deftypefn {Function} {} MIN (@var{number}, @var{number}[, @dots{}]) Results in the value of the least @var{value}. The @var{value}s may @@ -684,6 +697,15 @@ format specifier @var{format}. For example, @code{STRING(123.56, F5.1)} has the value @code{"123.6"}. @end deftypefn +@cindex strings, trimming +@cindex strings, truncating +@cindex white space, trimming +@deftypefn {Function} {} STRUNC (@var{string}, @var{n}) +Returns @var{string}, first trimming it to at most @var{n} bytes, then +removing trailing spaces. Returns an empty string if @var{n} is +missing or negative. +@end deftypefn + @cindex substrings @cindex strings, taking substrings of @deftypefn {Function} {} SUBSTR (@var{string}, @var{start})