HP 50g: Mantissa of an Extended Real
|
10-07-2017, 12:23 PM
Post: #1
|
|||
|
|||
HP 50g: Mantissa of an Extended Real
Does anyone have a programme to get the mantissa of an extended real on the 50g - the shorter the better?
|
|||
10-07-2017, 03:24 PM
Post: #2
|
|||
|
|||
RE: HP 50g: Mantissa of an Extended Real
Here is my attempt at a solution, but I fear the programme is too large & slow:
Code: :: |
|||
10-07-2017, 04:48 PM
Post: #3
|
|||
|
|||
RE: HP 50g: Mantissa of an Extended Real
(10-07-2017 03:24 PM)Gerald H Wrote: Here is my attempt at a solution, but I fear the programme is too large & slow: This is smaller and faster, but there's probably still a better way: Code: :: |
|||
10-07-2017, 06:19 PM
(This post was last modified: 10-07-2017 06:25 PM by Gerald H.)
Post: #4
|
|||
|
|||
RE: HP 50g: Mantissa of an Extended Real
Excellent, DavidM!
Much faster than any programme I have seen to find extended mantissa. Deals with %%0 & negative powers correctly, only critique is negative numbers remain negative. |
|||
10-07-2017, 06:33 PM
Post: #5
|
|||
|
|||
RE: HP 50g: Mantissa of an Extended Real
(10-07-2017 06:19 PM)Gerald H Wrote: ...negative numbers remain negative. I'll admit that I didn't test this out extensively, but I did try at least one negative number and the sign was changed to positive (as it should have been, due to the DAT0=C P step). What did you test with this that didn't result in a positive mantissa? |
|||
10-07-2017, 07:38 PM
(This post was last modified: 10-07-2017 07:39 PM by Gerald H.)
Post: #6
|
|||
|
|||
RE: HP 50g: Mantissa of an Extended Real
Various negatives,eg %% -7.7E1, %% -1E0, %% -1E66, the negative sign is consistently retained.
I haven't found one negative number that shows a positive mantissa. |
|||
10-07-2017, 07:46 PM
Post: #7
|
|||
|
|||
RE: HP 50g: Mantissa of an Extended Real
Sorry, I must have erred in copying the instructions, on recompiling the negatives are dealt with correctly.
|
|||
10-07-2017, 07:55 PM
Post: #8
|
|||
|
|||
RE: HP 50g: Mantissa of an Extended Real
(10-07-2017 07:46 PM)Gerald H Wrote: Sorry, I must have erred in copying the instructions, on recompiling the negatives are dealt with correctly. No problem. You had me really scratching my head for a while there, though. I should have included the checksum/byte count as a safeguard. Here's the commented code, in case anyone is interested. I did swap two lines in this one to make the flow more consistent (it doesn't make a difference in the result, of course). Checksum: FAECh Bytes: 41 Code: :: |
|||
10-07-2017, 09:36 PM
Post: #9
|
|||
|
|||
RE: HP 50g: Mantissa of an Extended Real
Quite informative, thank you.
Arno |
|||
10-08-2017, 06:42 AM
Post: #10
|
|||
|
|||
RE: HP 50g: Mantissa of an Extended Real
Some background:
You may remember a library for the 48G http://www.hpcalc.org/details/1243 called EXMATH which took control of screen & keyboard & created an RPN calculator working with exponents up to 49999. I have updated the library to work on the 49G ver 1.19-6 & 2.10-7 & on the 50g ver 2.10-7, adding some extra functions & trying to improve performance. I am confident that my own programming is not optimal & am very grateful for assistance. |
|||
10-08-2017, 07:43 AM
Post: #11
|
|||
|
|||
RE: HP 50g: Mantissa of an Extended Real
Helping with things like that is for the time being way beyond my abilities (and the amount of time I can invest), I am refreshing my URPL which hadn't been used for mor than 10 years, I have recently started looking into the available SRPL books and I like writing little programs. So I usually have a close look at your programs which always seem to be very effective.
Arno |
|||
10-09-2017, 10:17 AM
Post: #12
|
|||
|
|||
RE: HP 50g: Mantissa of an Extended Real
The annotations are very welcome, DavidM, as I am fearful of writing any assembly language code & regard its effect as magical.
Writing programmes in User & Sys RPL requires much less initiation, really just a mechanized form of algebra. I think, Arno, that the change from User to Sys is not so big a step & the gain in speed is well worth the effort. I look forward to you writing some interesting programmes. |
|||
10-09-2017, 02:45 PM
Post: #13
|
|||
|
|||
RE: HP 50g: Mantissa of an Extended Real
(10-09-2017 10:17 AM)Gerald H Wrote: The annotations are very welcome, DavidM, as I am fearful of writing any assembly language code & regard its effect as magical. I think of writing Saturn code in a similar fashion to building furniture out of Lego blocks. It can be done, but you better have both a good reason and a good plan or you'll go insane before you finish it. Although I rarely choose assembly solutions as a first approach, this one seemed like a perfect fit -- simply setting the exponent and sign fields to 0 was all that was needed, and I knew that would be fairly easy (and fast) in assembly. (10-09-2017 10:17 AM)Gerald H Wrote: I think, Arno, that the change from User to Sys is not so big a step & the gain in speed is well worth the effort. I look forward to you writing some interesting programmes. I agree! |
|||
10-10-2017, 06:32 PM
Post: #14
|
|||
|
|||
RE: HP 50g: Mantissa of an Extended Real
(10-08-2017 06:42 AM)Gerald H Wrote: ... where can we find it? Hardware: Hp48S - Hp50g (5x black + 1 blue) - HP39gII - Hp27s - Casio fx-CG50 |
|||
10-10-2017, 06:39 PM
Post: #15
|
|||
|
|||
RE: HP 50g: Mantissa of an Extended Real | |||
10-13-2017, 05:41 AM
Post: #16
|
|||
|
|||
RE: HP 50g: Mantissa of an Extended Real
(10-10-2017 06:32 PM)franz.b Wrote:(10-08-2017 06:42 AM)Gerald H Wrote: ... Now available at http://www.hpcalc.org/details/8702 |
|||
10-13-2017, 06:52 AM
Post: #17
|
|||
|
|||
RE: HP 50g: Mantissa of an Extended Real
(10-13-2017 05:41 AM)Gerald H Wrote:(10-10-2017 06:32 PM)franz.b Wrote: where can we find it? thank you very much! I saw it yesterday in hpcalc news and today in hpforums posts! Hardware: Hp48S - Hp50g (5x black + 1 blue) - HP39gII - Hp27s - Casio fx-CG50 |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 3 Guest(s)