nPositive ABS(<nExp>) nCode ASC(<cExp>) TRUE || FALSE BETWEEN(<TargetData>, <FirstData>, <SecondData>) nNumber BIN2I(<cSignedInt>) nNumber BIN2L(<cSignedInt>) nNumber BIN2W(<cUnsignedInt>) cChar CHR(<nCode>) <nValue> DSTRTON(<sString>) lEmpty EMPTY(<exp>) nAntilogarithm EXP(<nExponent>) <nValue> FSTRTON(<sString>) nGCD FT_GCD( <nNumber1>, <nNumber2> ) nNetPV FT_NETPV( <nInitialInvestment>, <nInterestRate>, <aCashFlow> ; [, <nNoOfCashFlows> ] ) nRand FT_RAND1( <nMax> ) nNumber FT_ROUND( <nNumber> [, <nRoundToAmount> ; [, <cRoundType> [, <cRoundDirection> ; [, <nAcceptableError> ] ] ] ] ) <sStr> HASHNAME(<nHashCode>) <nHashCode> HASHSTR(<sStr>) cBinaryInteger I2BIN(<nInteger>) nInteger INT(<nExp>) lBoolean ISDIGIT(<cString>) cBinaryInteger L2BIN(<nExp>) nCount LEN(<cString> | <aTarget>) nNaturalLog LOG(<nExp>) dLarger MAX(<nExp1>, <nExp2>) --> nLarger MAX(<dExp1>, <dExp2>) dSmaller MIN(<nExp1>, <nExp2>) --> nSmaller MIN(<dExp1>, <dExp2>) nRemainder MOD(<nDividend>, <nDivisor>) NIL QOUT([<exp list>]) --> NIL QQOUT([<exp list>]) nRounded ROUND(<nNumber>, <nDecimals>) nRoot SQRT(<nNumber>) cFormatString TRANSFORM(<exp>, <cSayPicture>) cType TYPE(<cExp>) nNumber VAL(<cNumber>) cType VALTYPE(<exp>)
ABS(<nExp>) --> nPositive
ABS() is a numeric function that determines the magnitude of a numeric value independent of its sign. It lets you, for example, obtain the difference between two numbers as a positive value without knowing in advance which of the two is larger.
As a formalism, ABS(x) is defined in terms of its argument, x, as follows: if x >= 0, ABS(x) returns x; otherwise, ABS(x) returns the negation of x.
BIN2I(<cSignedInt>) --> nNumber
BIN2I() is a low-level file function that is used with FREAD() to convert a two-byte character string formatted as a signed integer to a xClipper numeric data type. This is most useful when you are reading foreign file types and want to read numeric data in its native format.
<cSignedInt> | is a character string in the form of a 16-bit signed integer number--least significant byte first. Only the first two characters are used by the function; all others are ignored. |
Returns : | BIN2I() returns an integer numeric value. |
See also : | BIN2L() BIN2W() FREAD() FREADSTR() I2BIN() L2BIN() |
BIN2L(<cSignedInt>) --> nNumber
BIN2L() is a low-level file function that is used with FREAD() to convert a four-byte character string formatted as a signed integer to a xClipper numeric data type. This is most useful when you are reading foreign file types and want to read numeric data in its native format.
<cSignedInt> | is a character string in the form of a 32-bit signed integer number--least significant byte first. Only the first four characters are used by the function; all others are ignored. |
Returns : | BIN2L() returns an integer numeric value. |
See also : | BIN2I() BIN2W() FREAD() FREADSTR() I2BIN() L2BIN() |
BIN2W(<cUnsignedInt>) --> nNumber
BIN2W() is a low-level file function that is used with FREAD() to convert a two-byte character string formatted as an unsigned integer to a xClipper numeric data type. This is most useful when you are reading from a binary file and want to read data in its native format.
<cUnsignedInt> | is a character string in the form of a 16-bit unsigned integer number--least significant byte first. Only the first two characters are used by the function; all others are ignored. |
Returns : | BIN2W() returns an integer numeric value. |
See also : | BIN2I() BIN2L() FREAD() FREADSTR() I2BIN() L2BIN() |
EXP(<nExponent>) --> nAntilogarithm
EXP() is a mathematical function that calculates the value, y, (the antilogarithm) of the following equation,
e**x = y
where e is the base of natural logarithms (2.71828...) and x is <nExponent>. The maximum value of <nExponent> is 45 before a numeric overflow occurs. EXP() and LOG() are inverse functions.
The number of decimal places displayed is determined solely by SET DECIMALS regardless of the current SET FIXED value.
<nExponent> | is the natural logarithm for which a numeric value is to be calculated. |
Returns : | EXP() returns a numeric value that is equivalent to the value e raised to the specified power. |
See also : | LOG() |
FT_GCD( <nNumber1>, <nNumber2> ) --> nGCD
This function calculates the greatest common divisor between 2 numbers, i.e., the largest number that will divide into both numbers evenly. It will return zero (0) if either number is zero.
FT_NETPV( <nInitialInvestment>, <nInterestRate>, <aCashFlow> ; [, <nNoOfCashFlows> ] ) --> nNetPV
This function calculates the net present value, the difference between the cost of an initial investment and the present value of the expected cash flow(s) from the investment. The present value of the expected cashflow(s) is calculated at the specified interest rate, which is often referred to as the "cost of capital".
This function can be used to evaluate alternative investments. The larger the NPV, the more profitable the investment. See also the FutureValue and PresentValue for further explanations. The formula to calculate the net present value is:
NetPresentValue = SUM(CashFlow[i] / ((1 + InterestRate) ** i)) FOR i = 1 TO NoOfCashFlows
<nInitialInvestment> | is the amount of cash invested for purposes of generating the cash flows. |
<nInterestRate> | is the annual interest rate used to discount expected cash flows (10.5% = 10.5, not .105). |
<aCashFlow> | is an array of the expected cash receipts each year. |
<nNoOfCashFlows> | is the number of years cash flows are expected (optional, Len( aCashFlow ) ). |
Returns : | The difference between the initial investment and the discounted cash flow in dollars. |
FT_RAND1( <nMax> ) --> nRand
Generates a non-integer random number based on the Linear Congruential Method.
If you need a random number between 1 and <nMax> inclusive, INT() the result and add 1.
If you need a random number between 0 and <nMax> inclusive, then you should ROUND() the result.
FT_ROUND( <nNumber> [, <nRoundToAmount> ; [, <cRoundType> [, <cRoundDirection> ; [, <nAcceptableError> ] ] ] ] ) --> nNumber
This function will allow you to round a number. The following can be specified: a. Direction (up, down or normal - normal is 4/5 convention) b. Type (whole, decimal, fraction) c. Amount (100's, 5 decimals, 16th, etc.)
<nNumber> | is the number to round |
<nRoundToAmount> | is the fraction to round to or the number of places, default is 2. |
<cRoundType> | is the type of rounding desired "D" for Decimal (3 for thousandth, 1/1000) (default) "F" for Fraction (3 for thirds, 1/3) "W" for Whole numbers (3 for thousand, 1000) |
<cRoundDirection> | is the direction to round the number toward "U" to round Up 1.31 --> 1.4 -1.31 --> -1.4 "D" to round Down 1.36 --> 1.3 -1.36 --> -1.3 "N" to round Normal 1.5 --> 2 -1.5 --> -2 1.49 --> 1 -1.49 --> -1 |
<nAcceptableError> | is the amount that is considered acceptable to be within, i.e., if you're within this amount of the number you don't need to round |
Returns : | The number, rounded as specified. |
I2BIN(<nInteger>) --> cBinaryInteger
I2BIN() is a low-level file function that converts an integer numeric value to a character string formatted as a binary integer--least significant byte first. I2BIN() is used with FWRITE() to convert a xClipper numeric to a standard binary form. The inverse of I2BIN() is BIN2I().
INT(<nExp>) --> nInteger
INT() is a numeric function that converts a numeric value to an integer by truncating--not rounding--all digits to the right of the decimal point. INT() is useful in operations where the decimal portion of a number is not needed.
<nExp> | is a numeric expression to be converted to an integer. |
Returns : | INT() returns an integer numeric value. |
See also : | ROUND() |
L2BIN(<nExp>) --> cBinaryInteger
L2BIN() is a low-level file function used with FWRITE() to write xClipper numeric values to a binary file. This function is like I2BIN() which formats a xClipper numeric to a 16-bit binary value.
L2BIN() is the inverse function of BIN2L().
LOG(<nExp>) --> nNaturalLog
LOG() is a numeric function that calculates the natural logarithm of a number and is the inverse of EXP(). The natural logarithm has a base of e which is approximately 2.7183. The LOG() function returns x in the following equation,
e**x = y
where y is the numeric expression used as the LOG() argument (i.e., LOG(y) = x). Due to mathematical rounding, the values returned by LOG() and EXP() may not agree exactly (i.e., EXP(LOG(x)) may not always equal x).
<nExp> | is a numeric value greater than zero to be converted to its natural logarithm. |
Returns : | LOG() returns the natural logarithm as a numeric value. If <nExp> is less than or equal to zero, LOG() returns a numeric overflow (displayed as a row of asterisks). |
See also : | EXP() |
MAX(<nExp1>, <nExp2>) --> nLarger MAX(<dExp1>, <dExp2>) --> dLarger
MAX() is a numeric and date function that ensures the value of an expression is larger than a specified minimum. The inverse of MAX() is MIN(), which returns the lesser of two numeric or date values.
<nExp1> | and <nExp2> are the numeric values to be compared. |
<dExp1> | and <dExp2> are the date values to be compared. |
Returns : | MAX() returns the larger of the two arguments. The value returned is the same type as the arguments. |
See also : | MIN() |
MIN(<nExp1>, <nExp2>) --> nSmaller MIN(<dExp1>, <dExp2>) --> dSmaller
MIN() is a numeric and date function that ensures the value of an expression is smaller than a specified minimum. The inverse of MIN() is MAX() which returns the greater of two numeric or date values.
<nExp1> | and <nExp2> are the numeric values to be compared. |
<dExp1> | and <dExp2> are the date values to be compared. |
Returns : | MIN() returns the smaller of the two arguments. The value returned is the same data type as the arguments. |
See also : | MAX() |
MOD(<nDividend>, <nDivisor>) --> nRemainder
MOD() is a numeric function that emulates the dBASE III PLUS MOD() function.
MOD() is supplied as a compatibility function and therefore not recommended. It is superseded entirely by the modulus operator (%).
ROUND(<nNumber>, <nDecimals>) --> nRounded
ROUND() is a numeric function that rounds <nNumber> to the number of places specified by <nDecimals>. Specifying a zero or negative value for <nDecimals> allows rounding of whole numbers. A negative <nDecimals> indicates the number of digits to the left of the decimal point to round. Digits between five to nine (inclusive) are rounded up. Digits below five are rounded down.
The display of the return value does not obey the DECIMALS setting unless SET FIXED is ON. With SET FIXED OFF, the display of the return value contains as many decimal digits as you specify for <nDecimals>, or zero, if <nDecimals> is less than one.
SQRT(<nNumber>) --> nRoot
SQRT() is a numeric function used anywhere in a numeric calculation to compute a square root (e.g., in an expression that calculates standard deviation).