Could you please change "ccccc > fff" to "ccccc >= fff" so that ccccc can count down to and include 0.
Thanks.
34S SUM PROD change request ccccc >= fff
|
|
« Next Oldest | Next Newest »
|
▼
10-01-2011, 11:53 AM
Could you please change "ccccc > fff" to "ccccc >= fff" so that ccccc can count down to and include 0. Thanks. ▼
10-01-2011, 08:14 PM
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.
/**************************************************************************/ ▼
10-01-2011, 10:58 PM
DSL and ISE are now present :-) - Pauli
10-02-2011, 06:39 AM
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. ▼
10-02-2011, 07:47 AM
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.
|