Pi Approximation Day
|
07-23-2022, 05:18 PM
(This post was last modified: 07-23-2022 05:30 PM by C.Ret.)
Post: #12
|
|||
|
|||
RE: Pi Approximation Day
(07-23-2022 03:41 PM)Gerson W. Barbosa Wrote:(07-23-2022 03:18 PM)C.Ret Wrote: Is this a specific HP-42S trick, does memory recall arithmetic modify the LAST register?Yes, it does, unlike memory store arithmetic: Thank you for your quick response; this is a different behavior from the HP-15C memory recall arithmetic logic. That explain why I was so lost. 001 LBL "WLP 002 10 003 ENTER^ 004 LBL 00 005 RCL Y 006 X^2 007 LASTX 008 + 009 -3 010 Y^X 011 - 012 DSE Y 013 GTO 00 014 SQRT 015 END With FIX 7 display format, this little program give a better approximation of PI than 22/07. Surprisingly, the number of instructions is the same as Valentin Albillo's original code. \( \sqrt{10-\frac{1}{\left ( 10^2+10 \right )^3}-\frac{1}{\left ( 9^2+9 \right )^3}-\frac{1}{\left ( 8^2+8 \right )^3}-\cdots -\frac{1}{\left ( 2^2+2 \right )^3}-\frac{1}{\left ( 1^2+1 \right )^3}} = \sqrt{ \frac{2\,780\,722\,699}{281\,746\,080} } \approx \pi \) |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 2 Guest(s)