Programming Exercise (HP-15C, 15C LE - and others)
|
03-26-2014, 02:04 PM
Post: #39
|
|||
|
|||
RE: Programming Exercise (HP-15C, 15C LE - and others)
Alright, I've managed to implement this on what may be the weakest possible machine that can still handle the algorithm: the Sinclair Cambridge Programmable. The manual is available on Katie's site, but allow me to summarize the notable points for this barely-programmable calculator:
1. Precision is awful. Trig functions are often only accurate to 2 or 3 figures. 2. There's no built-in PI constant, but you can get about 5 digits from 2 * arccos 0 (all trig functions operate in radians). Or just key it in manually for better accuracy. 3. There's no y^x operator. You have to do e^(y * ln x), and like trig, it isn't particularly accurate. 4. You only get 36 completely unmerged program steps to work with. About half the available operations require two steps because of the down-shift key. Constant entry requires an additional 'escape' key. 5. There's only a single storage register. Thankfully, there's an operator to exchange the display with the register, otherwise I don't think this would have been possible. 6. Branching is all absolute, and requires FOUR steps (shift, go to/go if neg, two-digit step number). 7. 'go if neg' is the only conditional test available. If the display is negative, it acts like go to, otherwise skips the next two steps (the line number). To use, enter the desired number of iterations (e.g. 10000) in the display, and press RUN. Code: 00 sto 100 iterations (50 actual passes through the loop) takes 18.5 seconds. A full run of 10000 iterations would clock in at about 30 minutes. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)