Hi all,

I'm working on issue 15090 (http://www.openoffice.org/issues/show_bug.cgi?id=15090) and have some questions; Reference: OpenFormula-v1.2-draft7.odt;6.11.42 (cited at the end)

(1)
The error result for Nper<=0 is not implemented yet. I have seen
SetError(errIllegalArgument), SetIllegalArgument(), SetIllegalParameter(), and SetError(errIllegalParameter).
What is the right one in this case?

(2)
The parameter Nper has the type 'number'. May it be non integer? For non integer Nper there must be RATE>=-1 because of (1+Rate)^Nper. Should RATE<-1 be excluded in all cases or only if Nper isn't integer?

(3)
„RATE solves the equitation...“
In many cases there is not only one solution but there are two, sometimes three. Currently OOo returns solutions, which are far away from 0, Excel doesn't, what the issue is about. But what to do, if the user starts with a GUESS that will lead to such a solution and the user sets GUESS to that value with the intention to get such solution?

(4)
What role should GUESS have? "start the iterative computation" makes not sure, that different implementations will return the same value.

(5)
What should RATE return, if solutions exist, but values are far away from 0? Example: Nper=4; Pv=-1; Payment=0.82; Fv=2. It has one solution round RATE=100% and another one round RATE=-215%. Excel gives an error in this special case.

(6)
Technical questions:

Should I use tabs or spaces for indent?

The current text has German identifiers and parameters and German comments, for example fBw (which means 'Barwert') instead of fPv, which would fit to the specification. Change it?

The internal function 'GetZinsIterationEps' returns fEps, the last difference between neighbored values. That is used to determine whether the result is valid or not. This will fail, if you decide, that resolutions far away from 0 should not be valid although they solve the equation. May I change it to boolean in that case? Which boolean type has it to be, if I change it?

Does a document exist for conventions for source text?

kind regards
Regina

==== cited from OpenFormula-v1.2-draft7.odt =============

6.11.42 RATE
Summary: Compute the interest rate per period of an investment.
Syntax: RATE( Number Nper ; Number Payment ; Number Pv [ ; Number Fv = 0 [ ; Number PayType = 0 [ ; Number Guess = 0.1 ] ] ] )
Returns: Percentage
Constraints: If Nper is 0 or less than 0, the result is an error.
Semantics: Computes the interest rate of an investment. The parameters are:
Nper: the total number of payment periods.
Payment: the payment made in each period.
Pv: the present value of the investment.
Fv: the future value; default is 0.
PayType: the type of payment, defaults to 0. It is 0 if payments are due at the end of the period; 1 if they are due at the beginning of the period. Guess: An estimate of the interest rate to start the iterative computation. If omitted, 0.1 (10%) is assumed.
RATE solves this equation:
0= Fv+Pv *(1+Rate)^Nper + Payment * (1+Rate*PayType)*((1+Rate)^Nper-1)/Rate

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to