![]() |
34S SUM PROD change request ccccc >= fff - Printable Version +- HP Forums (https://archived.hpcalc.org/museumforum) +-- Forum: HP Museum Forums (https://archived.hpcalc.org/museumforum/forum-1.html) +--- Forum: Old HP Forum Archives (https://archived.hpcalc.org/museumforum/forum-2.html) +--- Thread: 34S SUM PROD change request ccccc >= fff (/thread-198997.html) |
34S SUM PROD change request ccccc >= fff - Egan Ford - 10-01-2011 Could you please change "ccccc > fff" to "ccccc >= fff" so that ccccc can count down to and include 0.
Thanks.
Re: 34S SUM PROD change request ccccc >= fff - Paul Dale - 10-01-2011 This is somewhat limited by the definition of DSE unfortunately. Here is the sum and product code as it currently exists in the firmware image. It is just a plain old keystroke program. Feel free to submit a patch :-) The stack will always be four levels deep when this code is run and registers 0-4 and flags 0-14 are freely available.
/**************************************************************************/ Re: 34S SUM PROD change request ccccc >= fff - Paul Dale - 10-01-2011 DSL and ISE are now present :-)
- Pauli
Re: 34S SUM PROD change request ccccc >= fff - Walter B - 10-02-2011 ... and documented in the manual :-)
Walter
Re: 34S SUM PROD change request ccccc >= fff - Marcus von Cube, Germany - 10-02-2011 Pauli, what is the reasoning behind the complicated summation. It must have to do with increasing accuracy but how does it work?
If you want to make the code shorter, the two loops may easily be merged and the operation selected by a flag inside the loop.
Re: 34S SUM PROD change request ccccc >= fff - Paul Dale - 10-02-2011 The summation is indeed an attempt to improve precision. The algorithm used is known as the Kahan sum. Essentially, it maintains the sum and some of the digits lost off the end in two registers. The lost digits act as a correction term as each new item is added in.
Re: 34S SUM PROD change request ccccc >= fff - Marcus von Cube, Germany - 10-02-2011 We will certainly be fighting for a handful of bytes again...
|