Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Is there an easy way to have the hp49 change a number to scientific notation?

43 views
Skip to first unread message

chris heaton

unread,
Aug 16, 2002, 6:27:08 PM8/16/02
to
I am taking physics an sometimes the results are large. Such as
1800000000. Will the calculator change it to scientific notation?

I tried to write a program that when you put the number in stack 2 and
the section you wanted to be multipled by 10^x in stack 1 it would
tell you the x.

It was
10. X ^ * SWAP = X SOLVE EQ> EVAL

THe problem is that it wont work in approximate mode,and it makes you
switch to approximate mode in the program. So it works, but I have to
switch back the mode every time or it will give me the error "None
unary operator".

Bill Storey

unread,
Aug 17, 2002, 7:14:14 AM8/17/02
to
In article <89d0a867.02081...@posting.google.com>,
cmhth...@yahoo.com (chris heaton) writes:

>Subject: Is there an easy way to have the hp49 change a number to
scientific
>notation?
>From: cmhth...@yahoo.com (chris heaton)
>Date: 16 Aug 2002 15:27:08 -0700

If you generally want to display in Sci Notation, use "MODE" "Number Format"
and select either "SCI" for strict scientific notation, or ENG for power of
10^3 Scientific notation. Also, there was a program posted by JHM which
mimicked the Casio ability to change mantissa and exponent display mode. Check
www.hpcalc.org.

Some possibilities.
http://www.hpcalc.org/details.php?id=1649
http://www.hpcalc.org/details.php?id=1603
http://www.hpcalc.org/details.php?id=2868

Bill
alternate E-dress wtst...@ieee.org.no.spam.please
(Use the obvious)

John H Meyers

unread,
Aug 30, 2002, 2:22:52 AM8/30/02
to chris heaton
chris heaton wrote:

> I am taking physics and sometimes the results are large.

Or small?

> Will the calculator change it to scientific notation?

You could, of course, just leave the whole display in "scientific"
mode, e.g. 11. SCI, but if you want to keep it in a FIX or STD mode
and yet have a program to interpret just one item "scientifically"
when desired, displaying it in the screen status area, say, see:

http://groups.google.com/groups?selm=5vkeg4%24jiq%241%40news.iastate.edu

Inserting a middle line here to accommodate the new-fangled HP49:

\<< "" 2. DISP 1. FREEZE RCLF OVER 11. SCI
DUP TYPE 28. == { I\->R } IFT 2. \->HEADER
1. DISP STOF \>>

-----------------------------------------------------------
With best wishes from: John H Meyers http://www.mum.edu


-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 80,000 Newsgroups - 16 Different Servers! =-----

Eric Smith

unread,
Aug 31, 2002, 3:06:27 AM8/31/02
to
chris heaton wrote:
> Will the calculator change it to scientific notation?

John H Meyers <jhme...@miu.edu> writes:
> You could, of course, just leave the whole display in "scientific"
> mode, e.g. 11. SCI, but if you want to keep it in a FIX or STD mode
> and yet have a program to interpret just one item "scientifically"
> when desired, displaying it in the screen status area, say, see:
>
> http://groups.google.com/groups?selm=5vkeg4%24jiq%241%40news.iastate.edu

One thing I always wanted on an HP, since I first used them back in the
HP-67 days, was a FIX/ENG mode. This would worklike FIX mode, but when
the number was too large to represent in FIX, would display it in ENG
instead (rather than SCI).

For the most part, I have no use whatsoever for SCI mode. Whenever I
see an exponent that is not a multiple of 3, I end up doing the conversion
to ENG mentally anyhow, and I'd rather the calculator do it for me.

I'm tempted to hack up some new microcode for the HP-41 to make the FIX mode
behave this way. It might be possible to do that in one of the polls, so
that an expansion ROM (or a HEPAX module) could provide this feature, rather
than needing to replace one of the internal ROMs.

chris heaton

unread,
Sep 1, 2002, 9:18:42 PM9/1/02
to
Thanks for all of the help everyone.

I did not realize that the mode could be changed just by typing in
SCI, I thought I had to click mode and change it manually.

With that knowledge I wrote the simple program <<DUP 9 SCI "" + MSGBOX
STD>> and it did exactly what I wanted.

John H Meyers

unread,
Sep 3, 2002, 6:47:28 AM9/3/02
to chris heaton
chris heaton wrote:

> thought I had to click "mode" and change it manually.

Everything is programmable, even keyboard key actions, e.g.:

-41 KEYEVAL does what the HIST key does.

[r->] [OFF]

.

John H Meyers

unread,
Sep 3, 2002, 6:58:49 AM9/3/02
to
Eric Smith wrote:

> One thing I always wanted on an HP, was a FIX/ENG mode.
> This would work like FIX mode, but when the number was


> too large to represent in FIX, would display it in ENG
> instead (rather than SCI).

Here's something that always displays level-1 in ENG mode
in the status area, without otherwise affecting the
display mode of the stack area (which you can leave in FIX):

\<< 2. \->HEADER @ omit for HP48
DROP DEPTH { RCLF OVER


DUP TYPE 28. == { I\->R } IFT

DUP TYPE 10. == { B\->R } IFT
DUP TYPE { DROP }
{ 11. ENG 1. DISP "" 2. DISP 1. FREEZE }
IFTE STOF } IFT \>> '\GbENTER' STO

-62. SF -63. SF @ User mode and Custom Enter

\Gb represents a Greek beta character (alpha right-shift B);
the exact name shown must be used.


It is also possible to test the exponent (XPON) of any
real value on level-1, and to change the stack display mode
according to that exponent.

[r->] [OFF]

.

Gene Wright

unread,
Sep 3, 2002, 9:54:22 AM9/3/02
to
Might just be too early for a Tuesday, but wasn't it possible by
synthetically setting some HP-41 flags to force it into a Fix/Eng mode?

I'm almost certain I remember that from a PPC Journal.

Gene

--
* All opinions herein expressed are mine and *
* mine alone. You may choose to ignore them *
* but I own them. *


"Eric Smith" <eric-no-s...@brouhaha.com> wrote in message
news:qhbs7js...@ruckus.brouhaha.com...

Eric Smith

unread,
Sep 3, 2002, 3:26:50 PM9/3/02
to
"Gene Wright" <dwri...@ford.invalid> writes:
> Might just be too early for a Tuesday, but wasn't it possible by
> synthetically setting some HP-41 flags to force it into a Fix/Eng mode?
>
> I'm almost certain I remember that from a PPC Journal.

Yes, you can force both the FIX and ENG flags to be set. But it doesn't
do what you'd expect. :-(

Wayne Brown

unread,
Sep 3, 2002, 4:51:48 PM9/3/02
to

I keep my 41 in FEX (Fix/Eng) mode all the time, and it does what I
expect it to do. For instance, if I set it to FEX 4 and enter:

123456 <ENTER>

it displays 12345.0000. If I then square it, it displays:

15.241 09

What would you expect it to do? Are you referring to the fact that it
only shows 3 digits rather than 4 after the decimal? But that's the
way standard ENG 4 mode works on the 41 too, so I'd expect FEX 4 to work
the same way. Or are you referring to something else?

--
Wayne Brown | "When your tail's in a crack, you improvise
fwb...@bellsouth.net | if you're good enough. Otherwise you give
| your pelt to the trapper."
"e^(i*pi) = -1" -- Euler | -- John Myers Myers, "Silverlock"

Gene Wright

unread,
Sep 3, 2002, 5:08:48 PM9/3/02
to
Which flags do you set to put it into Fix/Eng mode? Could one use the PPC
ROM or some other method (Bug 3 anyone?) to do this?

That "FEX" isn't a special plug-in rom function, is it?

Gene

--
* All opinions herein expressed are mine and *
* mine alone. You may choose to ignore them *
* but I own them. *


"Wayne Brown" <fwb...@bellsouth.net> wrote in message
news:Eh9d9.68995$vY2.1...@e3500-atl2.usenetserver.com...

Eric Smith

unread,
Sep 3, 2002, 7:06:57 PM9/3/02
to
I wrote:
> Yes, you can force both the FIX and ENG flags to be set. But it doesn't
> do what you'd expect. :-(

Wayne Brown <fwb...@bellsouth.net> writes:
> I keep my 41 in FEX (Fix/Eng) mode all the time, and it does what I
> expect it to do. For instance, if I set it to FEX 4 and enter:

My recollection was that it sort of worked, but displayed some numbers
with bogus characters in place of digits. Perhaps I'm completely confused.

Wayne Brown

unread,
Sep 4, 2002, 11:39:57 AM9/4/02
to
Gene Wright <dwri...@ford.invalid> wrote:
> Which flags do you set to put it into Fix/Eng mode? Could one use the PPC
> ROM or some other method (Bug 3 anyone?) to do this?

> That "FEX" isn't a special plug-in rom function, is it?

FEX is a little program I use to set flags 40 and 41 at the same time,
which enables both FIX and ENG modes. It came from an article called
"FEX for HP-41CX Using GETKEYX" by Terry Griffin in "PPC Journal" V13N8
(November 1986). It uses the extended functions STOFLAG and RCLFLAG to
change the flags register, as well as other extended functions like XTOA
and GETKEYX for a little bit prettier user interface. I also have another
version that I made for the 41C/CV which uses GETKEY instead of GETKEYX
(because the latter is only available on the CX). It's quite a bit
longer than the CX version and requires the Extended Functions module
because it still uses XTOA, STOFLAG, and RCLFLAG. Using synthetics
it would be possible to eliminate the extended functions altogether.
(If you have the PPC ROM, you can just use its IF (Invert Flags) function
to set flag 41 after doing a normal FIX instruction.)

In case anyone's interested, here's Terry Griffin's program for the CX.
There's one synthetic instruction, in line 2; the hex codes for that
line are F5 46 47 58 20 5F. For anyone who doesn't want to mess with
synthetics (and can do without the underscore character in the input
display), just replace line 2 with these three lines:

02 "FEX "
03 95
04 XTOA

Also, the "RUP" in lines 20 and 21 is actually the "rollup" instruction,
which I can't easily simulate in a plain ASCII posting.

I can post my C/CV version too if anyone's interested.


01 LABEL "FEX"
02 "FEX _"
03 AVIEW
04 "FEX "
05 9
06 GETKEYX
07 XTOA
08 AVIEW
09 X<>Y
10 CLX
11 48
12 -
13 ENG 0
14 RCLFLAG
15 FIX IND Y
16 X<>Y
17 CLX
18 41
19 STOFLAG
20 RUP
21 RUP
22 CLD
23 END

Wayne Brown

unread,
Sep 4, 2002, 11:41:54 AM9/4/02
to

I haven't run into that problem, but then I haven't displayed every
possible number in FEX mode, either. :-) Maybe I've just been lucky
so far.

Wayne Brown

unread,
Sep 5, 2002, 1:44:42 PM9/5/02
to
Wayne Brown <fwb...@bellsouth.net> wrote:

> I can post my C/CV version too if anyone's interested.

Well, I've had a request to post my HP-41C/CV version of FEX, so here
it is. It's based on Terry Griffin's FEX for the 41CX and is identical
to it except that GETKEYX (which is only available on the CX) has been
replaced with GETKEY. That means that lines 05 and 06 in the original
have been replaced with lines 05 through 36 in my version. (GETKEYX is
much simpler to use!) There's probably a better way to do this; this
is a quick-and-dirty solution, but it works.

This version requires the Extended Functions module to run on a 41C
or 41CV. It also uses one synthetic text line, line 02, with the hex
values F5 46 47 58 20 5F. Just as with the original version, line 02
can be replaced with these three lines:

02 "FEX "
03 95
04 XTOA

if you aren't familiar with entering synthetics.

Just for fun, I'm working on another version that uses synthetic
programming to eliminate the need for the Extended Functions module,
so that anyone with any model of 41 can use it without additional modules.
I'll post it here when it's ready.

01 LABEL "FEX"
02 "FEX _"
03 AVIEW
04 "FEX "

05 GETKEY
06 GTO IND X
07 LBL 52
08 55
09 GTO 00
10 LBL 53
11 56
12 GTO 00
13 LBL 54
14 57
15 GTO 00
16 LBL 62
17 52
18 GTO 00
19 LBL 63
20 53
21 GTO 00
22 LBL 64
23 54
24 GTO 00
25 LBL 72
26 49
27 GTO 00
28 LBL 73
29 50
30 GTO 00
31 LBL 74
32 51
33 GTO 00
34 LBL 81
35 48
36 LBL 00
37 XTOA
38 AVIEW
39 X<>Y
40 CLX
41 48
42 -
43 ENG 0
44 RCLFLAG
45 FIX IND Y
46 X<>Y
47 CLX
48 41
49 STOFLAG
50 RUP
51 RUP
52 CLD
53 END

Wayne Brown

unread,
Sep 5, 2002, 2:35:22 PM9/5/02
to
A quick correction: in the 41C/CV version of FEX, this line:

34 LBL 81

should actually be:

34 LBL 82

Wayne Brown

unread,
Sep 6, 2002, 1:26:09 PM9/6/02
to
Wayne Brown <fwb...@bellsouth.net> wrote:

> Just for fun, I'm working on another version that uses synthetic
> programming to eliminate the need for the Extended Functions module,
> so that anyone with any model of 41 can use it without additional modules.
> I'll post it here when it's ready.

Here I am replying to myself again. I'm starting to feel schizophrenic.
:-)

This is my synthetic version of Terry Griffin's FEX program from
"PPC Journal" V13N8 (November 1986). For those who've just joined the
thread, FEX is a program for setting the "FIX" and "ENG" modes of the
HP-41 simultaneously (which can't be done directly from the keyboard).
It lets you display smaller numbers in ordinary fixed-point format,
with an automatic switch to engineering notation if the number becomes
too large or small to display in fixed format. Terry's original program
(which can be found further back in this thread) requires an HP-41CX;
I made a modified version (also posted earlier in this thread)
which works on a 41C or 41CV with the Extended Functions module.
This newest version eliminates all need for extended functions, but
it does make use of synthetic instructions. (If you're not familiar
with synthetic programming, there's a wonderful short introduction at
http://www.hpmuseum.org/prog/synth41.htm which also tells you how to
create a "byte grabber," the only synthetic tool needed for entering
this program.)

This version of FEX makes use of a technique that, to my knowledge,
was first discovered by Topi Linkala and documented in "PPC Journal"
V8N5P19 (July 1981). It involves using prefix 9C (the FIX instruction)
with postfixes ranging from hex 40 to 49 (or in decimal, 64 to 73).
These correspond to the normal FIX 0 through FIX 9, except that they
also set the ENG flag (flag 41) at the same time. You can't use these
codes from the keyboard (for example, FIX 68) because the keyboard
input routine won't accept them, but it's possible to insert them with
a synthetic program. These instructions appear in the program listing
below as normal FIX instructions, but they aren't really; for instance,
FIX 68 appears in the listing as FIX 8. For that reason I've included the
hex codes for each synthetic line next to the program line. I've also
used the ~ character in text strings to represent the APPEND character
(which is entered by pressing [SHIFT][XEQ] in ALPHA mode).


01 LABEL "FEX"
02 "FEX _" F5 46 47 58 20 5F


03 AVIEW
04 "FEX "
05 GETKEY
06 GTO IND X
07 LBL 52

08 "~7"
09 FIX 1 9C 47
10 GTO 00
11 LBL 53
12 "~8"
13 FIX 2 9C 48
14 GTO 00
15 LBL 54
16 "~9"
17 FIX 3 9C 49
18 GTO 00
19 LBL 62
20 "~4"
21 FIX 8 9C 44
22 GTO 00
23 LBL 63
24 "~5"
25 FIX 9 9C 45
26 GTO 00
27 LBL 64
28 "~6"
29 FIX 0 9C 46
30 GTO 00
31 LBL 72
32 "~1"
33 FIX 5 9C 41
34 GTO 00
35 LBL 73
36 "~2"
37 FIX 6 9C 42
38 GTO 00
39 LBL 74
40 "~3"
41 FIX 7 9C 43
42 GTO 00
43 LBL 82
44 "~0"
45 FIX 4 9C 40
46 LBL 00
47 AVIEW
48 PSE
49 RDN
50 CLD
51 END

Wayne Brown

unread,
Sep 10, 2002, 2:06:43 PM9/10/02
to
It was pointed out to me by Gene Wright that my so-called "all synthetic"
version of FEX still used one extended function -- the GETKEY function.
(That's what I get for failing to test it *without* an Extended
Functions module.) So I've tried one more time (the *last* time,
I hope!) to get it right. This version adds a couple more synthetic
instructions and a flag test to remove the need for GETKEY. My whole
objective in this (as in Terry Griffin's original FEX program, on which
this is based) was to make it act as much like the built-in FIX, SCI,
and ENG functions as possible; the prompt looks the same, and it does
not require pressing RUN/STOP after digit entry. Unfortunately, without
the use of either GETKEY or GETKEYX I've been unable to eliminate a small
delay in which the digit entered is displayed without the "FEX " prompt.
If anyone else knows how to fix this small cosmetic flaw, I'd like to
see their solution. Anyway, here's the new version. For the curious,
here's a brief description of how it works:

Lines 1-3 -- display the "FEX _" prompt.
Lines 4-8 -- loop until the Numeric Entry flag (flag 22) is set when
the user enters a digit.
Lines 9-38 -- set the appropriate display length in flags 36-39 as well
as turning on flag 40 (FIX mode) and flag 41 (ENG mode).
Lines 39-49 -- display the "FEX " prompt with the user-supplied digit
appended. It does this by using a synthetic instruction to
grab a copy of the Flag register (register d), setting the
digit display length to zero and turning off the decimal
point (flag 29), appending the digit in the X register
to the string in the ALPHA register, and restoring the
copy of the flags to register d.
Lines 50-53 -- return the stack (as much as possible) to its original
condition. (The X and Y registers are preserved, but
the contents of registers Z and T are lost.)

As before, I've added the appropriate hex values for the synthetic lines.
Note that line 43 really is a FIX 0 instruction, not a synthetic line!
It's the only FIX in this program that *isn't* a synthetic instruction.


01 LABEL "FEX"
02 "FEX _" F5 46 47 58 20 5F
03 AVIEW

04 CF 22
05 LBL 22
06 PSE
07 FC? 22
08 GTO 22
09 GTO IND X
10 LBL 00
11 FIX 4 9C 40
12 GTO 10
13 LBL 01
14 FIX 5 9C 41
15 GTO 10
16 LBL 02
17 FIX 6 9C 42
18 GTO 10
19 LBL 03
20 FIX 7 9C 43
21 GTO 10
22 LBL 04
23 FIX 8 9C 44
24 GTO 10
25 LBL 05
26 FIX 9 9C 45
27 GTO 10
28 LBL 06


29 FIX 0 9C 46

30 GTO 10
31 LBL 07
32 FIX 1 9C 47


33 GTO 10
34 LBL 08

35 FIX 2 9C 48
36 GTO 10
37 LBL 09
38 FIX 3 9C 49
39 LBL 10
40 RCL d 90 7E
41 X<>Y
42 FIX 0
43 CF 29
44 "FEX "
45 ARCL X
46 X<>Y
47 STO d 91 7E
48 AVIEW
49 PSE
50 RDN
51 RDN
52 CLD
53 END

0 new messages