| FT_GCD() | Calculate greatest common divisor of two numbers |
| FT_NETPV() | Calculate net present value |
| FT_RAND1() | Generate a random number |
| FT_ROUND() | Rounds a number to a specific place |
FT_GCD( <nNumber1>, <nNumber2> ) -> nGCD
The greatest common divisor of the 2 numbers, or 0 if either is 0.
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
| <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 ) ). |
The difference between the initial investment and the discounted cash flow in dollars.
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
FT_RAND1( <nMax> ) -> nRand
nRand is a random number between 0 (inclusive) and <nMax> (exclusive).
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
| <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 |
The number, rounded as specified.
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.)
| Пред. | Начало | След. |
| DISKUTILS | Уровень выше | TCP |