[VA] SRC #017 - April 1st, 2024 Spring Special
|
04-02-2024, 08:29 AM
(This post was last modified: 04-02-2024 08:36 AM by J-F Garnier.)
Post: #2
|
|||
|
|||
RE: [VA] SRC #017 - April 1st, 2024 Spring Special
(04-01-2024 06:59 PM)Valentin Albillo Wrote: As we have that GCD(15, 4) = 1 and GCD(15, 5) = 5, for what value of x is GCD(15, x) = 2 ? OK, let's try to solve GCD(15,X)=2 for X on the 71B w/ Math ROM. Since GCD only accepts integer values, I had to cast the X variable to the INT type. Choosing 0 and 10 as the initial guesses: >FNROOT(0,10,GCD(15,INT(FVAR))-2) 12.9999999999 We can safely round the result to X=13. An interesting result, isn't it? Quote:[*] [HP-71B specific] Try and deduce what result will be output by this expression without actually executing it: some regular numeric value ? Perhaps Inf or NaN ? An error message ? A long-running or indefinite internal loop ? I miserably failed to predict the result ! But I learnt something about the 71B solver... Quote:[*] [HP-71B specific] I executed this command-line expression on my HP-71B but it just resulted in System Error. What did I do wrong ? Bad addresses ? Forbidden range for PEEK$ ? Can you find out what's wrong ? Ah ! Nothing wrong, I even didn't need to try ... Quote:[*] [HP-71B specific] What does this HP-71B user-defined function compute ? It doesn't do much, I'm afraid. Quote:[*] [HP-71B specific] The HP-71B does not allow for variable names beginning with a 2-letter or more prefix (e.g. AB, CD7, MYTAXES, etc.) as many other pocket computers do, but executing this assignment in a program or from the keyboard ... Ah! another new "hidden feature" of the 71B ? I well remember the undocumented MEMORY function, that accepts up to 2 parameters, but isn't that useful (do first DESTROY ALL to get consistent results): >MEMORY(1,2) 1 More results later... J-F |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 7 Guest(s)