[42S] MANT Challenge
|
01-22-2014, 01:46 PM
(This post was last modified: 01-22-2014 02:18 PM by Dieter.)
Post: #4
|
|||
|
|||
RE: [42S] MANT Challenge
(01-22-2014 12:38 PM)Werner Wrote: Fails for 2e-02 and all 0<x<0.1 that are not 10^-n Simple solution: forget mathematics, use Alpha. Code: 01 CLA A never owned a 42s, so maybe there's a more elegant way of deleting the last two characters. This will also work on the 41-series if SCI 11 is replaced by SCI 9. Since the display mode is changed, a final command that resets it may be added. EDIT: Since always the last two characters are deleted, this only works for exponents up to ±99. The code can be adjusted accordingly, while keeping the original idea of using the internal formatting routine in Alpha mode: Code: 01 CLA This should work for all possible cases. In both routines the sign of X is preserved in the resulting mantissa. The basic idea is simple: Have X formatted in SCI mode and take the leftmost 14 characters. For X≥0 this may include a trailing "E" which is ignored when the string finally is converted back to a number. Dieter |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 8 Guest(s)