Comments and discussion on Valentin's 4th "Then and Now" - Area
|
01-19-2023, 09:23 PM
(This post was last modified: 01-19-2023 09:26 PM by J-F Garnier.)
Post: #5
|
|||
|
|||
RE: Comments and discussion on Valentin's 4th "Then and Now" - Area
First of all, thanks to Valentin for this new problem. It kept me busy for long hours.
Also the kind request to postpone our results for a few days was an interesting exercise. For now, I will just make a couple of comments purely focusing on the programming aspects: (01-19-2023 05:08 PM)Valentin Albillo Wrote: 1 DESTROY ALL @ DIM U @ H=1/3 @ D=FNROOT(1,1,SQR(FNG(FVAR))-FVAR) 1. You may wonder why Valentin explicitly declared the variable U ("DIM U"), and not the others. Don't remove this DIM statement! Its purpose is related to a HP-71B bug, still present in the latest 2CDCC version and documented here, that I can summarize as: don't create new variables in the functions called by INTEGRAL or FNROOT, but create/declare them before. Matter of fact, my own solution is buggy in that respect, since the X, X1 and X2 variables are created in the FNF function called by INTEGRAL: (01-12-2023 09:34 AM)J-F Garnier Wrote: 280 DEF FNF(Y)During my program development I manually called FNF surely several times before running the INTEGRAL function on it, so it was harmless, still to be safe X, X1 and X2 should be created before, for instance with: 55 REAL X,X1,X2 2. The "1/10^10" expression may look inefficient and be better replaced by 1E-10. The problem is that the HP-71 decompiles this value in standard format as .0000000001 that is difficult to re-read. This is one of the few minor annoyances of the HP-71 BASIC. I used the same 10^n trick for readability in my own solution. J-F |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 5 Guest(s)