X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=doc%2Fexpressions.texi;h=aef69ef8f05145adf995d207c159d32ba200c22b;hb=240ecae8130528a997cc10cffa7f7e9f61689cb2;hp=5898d53d77cd0c604666de83b5d171e6c5c8be2a;hpb=63387e3d127359bab6c4f53c27a9131ab4a9c348;p=pspp diff --git a/doc/expressions.texi b/doc/expressions.texi index 5898d53d77..aef69ef8f0 100644 --- a/doc/expressions.texi +++ b/doc/expressions.texi @@ -1,7 +1,16 @@ -@c Use @func when refering to a function. -@c Use @deftypefn for their definitions +@c PSPP - a program for statistical analysis. +@c Copyright (C) 2017, 2020 Free Software Foundation, Inc. +@c Permission is granted to copy, distribute and/or modify this document +@c under the terms of the GNU Free Documentation License, Version 1.3 +@c or any later version published by the Free Software Foundation; +@c with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. +@c A copy of the license is included in the section entitled "GNU +@c Free Documentation License". +@c +@c Use @func when referring to a function. +@c Use @deftypefn for their definitions @macro func{NAME} -@code{/NAME/} +@code{\NAME\} @end macro @node Expressions @@ -123,7 +132,7 @@ system-missing. The result of @code{0**0} is system-missing as well. @cindex @samp{-} @cindex negation @item - @var{a} -Reverses the sign of @var{a}. +Reverses the sign of @var{a}. @end table @node Logical Operators @@ -263,7 +272,7 @@ The sections below describe each function in detail. * Missing Value Functions:: MISSING NMISS NVALID SYSMIS VALUE * Set Membership:: ANY RANGE * Statistical Functions:: CFVAR MAX MEAN MEDIAN MIN SD SUM VARIANCE -* String Functions:: CONCAT INDEX LENGTH LOWER LPAD LTRIM NUMBER +* String Functions:: CONCAT INDEX LENGTH LOWER LPAD LTRIM NUMBER REPLACE RINDEX RPAD RTRIM STRING STRUNC SUBSTR UPCASE * Time and Date:: CTIME.xxx DATE.xxx TIME.xxx XDATE.xxx @@ -342,9 +351,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 @@ -409,7 +423,11 @@ functions. In particular, user-missing values for numeric variables are converted to system-missing values. @deftypefn {Function} {} MISSING (@var{expr}) -Returns 1 if @var{expr} has the system-missing value, 0 otherwise. +When @var{expr} is simply the name of a numeric variable, returns 1 if +the variable has the system-missing value or if it is user-missing. +For any other value 0 is returned. +If @var{expr} takes another form, the function returns 1 if the value is +system-missing, 0 otherwise. @end deftypefn @deftypefn {Function} {} NMISS (@var{expr} [, @var{expr}]@dots{}) @@ -425,10 +443,7 @@ variable ranges using the @code{@var{var1} TO @var{var2}} syntax. @end deftypefn @deftypefn {Function} {} SYSMIS (@var{expr}) -When @var{expr} is simply the name of a numeric variable, returns 1 if -the variable has the system-missing value, 0 if it is user-missing or -not missing. If given @var{expr} takes another form, results in 1 if -the value is system-missing, 0 otherwise. +Returns 1 if @var{expr} has the system-missing value, 0 otherwise. @end deftypefn @deftypefn {Function} {} VALUE (@var{variable}) @@ -621,7 +636,7 @@ empty string. Returns the number produced when @var{string} is interpreted according to format specifier @var{format}. If the format width @var{w} is less than the length of @var{string}, then only the first @var{w} -characters in @var{string} are used, e.g.@: @code{NUMBER("123", F3.0)} +characters in @var{string} are used, @i{e.g.}@: @code{NUMBER("123", F3.0)} and @code{NUMBER("1234", F3.0)} both have value 123. If @var{w} is greater than @var{string}'s length, then it is treated as if it were right-padded with spaces. If @var{string} is not in the correct @@ -756,7 +771,7 @@ Most time and date functions will not accept earlier dates. Times and dates are handled by @pspp{} as single numbers. A @dfn{time} is an interval. @pspp{} measures times in seconds. Thus, the following intervals correspond with the numeric values given: - + @example 10 minutes 600 1 hour 3,600 @@ -799,7 +814,7 @@ Returns a time corresponding to @var{ndays} days. Returns a time corresponding to @var{nhours} hours, @var{nmins} minutes, and @var{nsecs} seconds. The arguments may not have mixed signs: if any of them are positive, then none may be negative, and -vice versa. +vice versa. @end deftypefn @node Time Extraction @@ -953,7 +968,7 @@ that is, gives the date that @var{date-or-time} is in. For a time, results in the number of whole hours beyond the number of whole days represented by @var{date-or-time}. For a date, results in the hour (as an integer between 0 and 23) corresponding to -@var{date-or-time}. +@var{date-or-time}. @end deftypefn @cindex day of the year @@ -975,7 +990,7 @@ corresponding to @var{date}. @cindex time, in minutes @deftypefn {Function} {} XDATE.MINUTE (@var{time-or-date}) Results in the number of minutes (as an integer between 0 and 59) after -the last hour in @var{time-or-date}. +the last hour in @var{time-or-date}. @end deftypefn @cindex months @@ -1209,8 +1224,8 @@ include an NCDF function. The individual distributions are described individually below. @menu -* Continuous Distributions:: -* Discrete Distributions:: +* Continuous Distributions:: +* Discrete Distributions:: @end menu @node Continuous Distributions