HP50g small tips and trick
|
12-19-2016, 07:38 PM
Post: #4
|
|||
|
|||
RE: HP50g small tips and trick
Because the HP50 does not handle lists with zero or one element correctly, I had to come up with the following (unless I wanted to code separately for lists of size zero or one or two or more).
Sum List becomes << { 0 0 } Sum List} >> and Prod List becomes << {1 1} Prod List >>. This works but it seems silly to have the built functions do some tests to produce incorrect behavior then I program tests to satisfy their tests. In other cases, I needed (for a Monte Carlo choice from a list with varying weights) the running sum of an array. << OVER + >> STREAM. It probably doesn't work on empty lists. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)