Solve: "bad guess(es)" error...
|
05-30-2015, 11:16 PM
Post: #1
|
|||
|
|||
Solve: "bad guess(es)" error...
hi,
why this code Code:
gives error "Bad Guesses"? If I try with the values in Home I get the correct answer: 0.0459035... Code:
Thank you Salvo ∫aL√0mic (IT9CLU) :: HP Prime 50g 41CX 71b 42s 39s 35s 12C 15C - DM42, DM41X - WP34s Prime Soft. Lib |
|||
05-31-2015, 10:31 AM
(This post was last modified: 05-31-2015 10:53 AM by DrD.)
Post: #2
|
|||
|
|||
RE: Solve: "bad guess(es)" error...
Hi Salvo;
The program's local vars don't persist within the Solve app (out of scope). If you use Globals (see the reserved vars in the code below), the program works fine. <<A subroutine *could* be used to pass locals to reserved vars, and return the results back to yield, if necessary.>> Code:
|
|||
05-31-2015, 11:09 AM
Post: #3
|
|||
|
|||
RE: Solve: "bad guess(es)" error...
(05-31-2015 10:31 AM)DrD Wrote: Hi Salvo; thank you! It works. I'm using it in the first version for my program to calc Bonds (for now, however, this one, with the flag to calculate "financial year" -30/360- gives result for price a little different from the 12C, and sure my formulas aren't correct, and the Prime reset calculating yield for this option: please, try, advice...) here there are the code: Code:
∫aL√0mic (IT9CLU) :: HP Prime 50g 41CX 71b 42s 39s 35s 12C 15C - DM42, DM41X - WP34s Prime Soft. Lib |
|||
06-01-2015, 04:04 PM
Post: #4
|
|||
|
|||
RE: Solve: "bad guess(es)" error...
I'd also recommend using FNROOT instead. That is the normal root finder routine that is not an app function.
TW Although I work for HP, the views and opinions I post here are my own. |
|||
06-01-2015, 04:05 PM
Post: #5
|
|||
|
|||
RE: Solve: "bad guess(es)" error...
(06-01-2015 04:04 PM)Tim Wessman Wrote: I'd also recommend using FNROOT instead. That is the normal root finder routine that is not an app function. Thank you Tim, I'll try it soon for my program! Salvo ∫aL√0mic (IT9CLU) :: HP Prime 50g 41CX 71b 42s 39s 35s 12C 15C - DM42, DM41X - WP34s Prime Soft. Lib |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)