![free42 trig functions disappeared free42 trig functions disappeared](https://i.ytimg.com/vi/F5yii-5JZDY/maxresdefault.jpg)
![free42 trig functions disappeared free42 trig functions disappeared](https://i.pinimg.com/originals/77/6b/93/776b9368aacaa64419e52261d45e9dc3.png)
Right triangle calculator exemplifies this truth by taking in two values (one side and any other value) and returning all missing values in exact value and decimal form while displaying the formulas and calculation process for each of the missing values. Given any known side length of a 90-degree triangle and one other value (another side, angle, area value, etc), one can find all unknown values of the same 90 degree triangle. A 90 degree triangle is defined as a triangle with a right angle, or in other words, a ninety degree angle. Pop and discard the stack frame on RTN/END.Everything in trigonometry seems to revolve around the 90-degree triangle and its ratios. Either have multiple different RTN instructions that specify what to restore, or a separate instruction placed just before RTN that restores the stack using the registers that were saved in the current stack frame. If I were implementing it, I'd have one instruction such as FUNC (or possibly even just a different LBL, maybe FLBL for example) to push the entire stack, and leave the details of the stack restoration to just before the RTN. It starts making this look like RPL or other high-level languages, and adds complexity to allowing for functions like COMPLEX that can have different behavior depending on the inputs. I would vote against having to declare the number of inputs and outputs at the beginning of the function. This is all starting to sound like structured programming, which RPN definitely is not. I just released 2.5.24 with FUNC nn and RTNYES/RTNNO/RTNERR, let's see how that goes first. That would be pretty easy to implement, since the two-digit number passed to FUNC is just saved to a hidden variable and not used until RTN and friends perform the stack restoration. (01-14-2021 03:21 AM)Thomas Okken Wrote: Deciding the number of inputs and outputs dynamically could be handled by having another function that overrides the number saved by FUNC. but note that MEAN puts the old X in LASTx, so the pattern is R_ZTX, and that does match the behavior of FUNC 22. That almost corresponds to the behavior of FUNC 22, except for what ends up in LASTx. (01-13-2021 05:19 PM)Dave Britten Wrote: R_ZTL - A no-input, two-output function that overwrites X and Y, such as MEAN. That corresponds to the behavior of FUNC 01. (01-13-2021 05:19 PM)Dave Britten Wrote: R_XYZL - A no-input, one-output function, like RCL, DATE, etc. That corresponds to the behavior of FUNC 10. (01-13-2021 05:19 PM)Dave Britten Wrote: A few other examples that I could potentially implement if I needed them: The HP-42S doesn't have any built-in functions like this, but in Free42, FMA fits that pattern. That corresponds to the behavior of FUNC 31. Three-input, one-output function, or a four-input, one-output function. (01-13-2021 05:19 PM)Dave Britten Wrote: R_TTTX - Leave X alone, restore T into Y, Z, and T, and restore X to L. That corresponds to the behavior of FUNC 21. Similar to two-input, one-output functions like +. (01-13-2021 05:19 PM)Dave Britten Wrote: R_ZTTX - Leave X alone, restore Z to Y, T to Z and T, and X to L. That corresponds to the behavior of FUNC 11.
#FREE42 TRIG FUNCTIONS DISAPPEARED HOW TO#
(01-13-2021 05:19 PM)Dave Britten Wrote: I have some stack save/restore routines on my 42S that might offer some inspiration on how to design this. R_ZTL - A no-input, two-output function that overwrites X and Y, such as MEAN. R_XYZL - A no-input, one-output function, like RCL, DATE, etc. RYZTTX - A one-input, no-output function that drops the stack, and saves the previous X in L. (Are there any examples of these?)Ī few other examples that I could potentially implement if I needed them: R_TTTX - Leave X alone, restore T into Y, Z, and T, and restore X to L.
![free42 trig functions disappeared free42 trig functions disappeared](https://i.ytimg.com/vi/62si6366Upc/maxresdefault.jpg)
R_ZTTX - Leave X alone, restore Z to Y, T to Z and T, and X to L. Similar to one-input, one-output functions like LN, or some two-input, one-output functions like %.
![free42 trig functions disappeared free42 trig functions disappeared](https://2.bp.blogspot.com/-s_Muf5wLr8w/UvSwa0Z4faI/AAAAAAAAAFk/wOG_aXoUSwM/s1600/tri+(2).jpg)
R_YZTX - Leave X alone, restore Y, Z, T to their original positions, restore previous X into L. that register contains an output of the program that's calling the save/restore routines. An underscore signifies "leave it alone", i.e. The names start with R, followed by a list of what to restore to each stack register - X, Y, Z, T, L, in that order. Then there are a few different restore routines that restore the stack in various ways, called just before the program returns. SS - Save stack (saves the entire stack, including L) I have some stack save/restore routines on my 42S that might offer some inspiration on how to design this.