The Museum of HP Calculators

HP Forum Archive 14

[ Return to Index | Top of Index ]

HP-16C Programing
Message #1 Posted by Trent Moseley on 5 Apr 2005, 2:54 p.m.

In programing the 16-C in DECIMAL mode, is there any work-around to obtain either the INT or the FRAC function?

tm

      
Re: HP-16C Programing
Message #2 Posted by Vieira, Luiz C. (Brazil) on 5 Apr 2005, 5:18 p.m.,
in response to message #1 by Trent Moseley

Hello, Trent;

back to some years ago, I remembered Nenad Vulic gave us a brilliant solution for this matter. Follow this thread and you'll see a very good approach from him.

Best regards.

Luiz (Brazil)

            
Re: HP-16C Programing
Message #3 Posted by Trent Moseley on 5 Apr 2005, 7:45 p.m.,
in response to message #2 by Vieira, Luiz C. (Brazil)

Luiz,

Vulic's program works! Thank you so much.

tm

                  
A minor improvement
Message #4 Posted by Cameron on 6 Apr 2005, 2:03 p.m.,
in response to message #3 by Trent Moseley

If you can afford the program storage and the convenience of sign preservation is helpful, you could add a few steps to Vulic's program:

LBL A
X<0?
SF 0
ABS
ENTER
ENTER
EEX
[9]
[+]
LSTx
[-]
x>y?
[1]
[0]
ENTER
[1]
[0]
[/]
[-]
F? 0
CHS
CF 0
RTN
Unfortunately this solution won't work on my simulator because I'm using the IEEE FPU. The design of my BCD FP simulator is well advanced so this limitation will go away in the future.

Cameron

            
Re: HP-16C Programing
Message #5 Posted by Cameron on 6 Apr 2005, 2:09 p.m.,
in response to message #2 by Vieira, Luiz C. (Brazil)

Thanks for the link, Luiz. I'd missed that thread the first time 'round.

Cameron

                  
Took me a while to find ;-)...
Message #6 Posted by Vieira, Luiz C. (Brazil) on 6 Apr 2005, 4:24 p.m.,
in response to message #5 by Cameron

You're welcome, Cameron.

Cheers.

Luiz (Brazil)

      
Re: HP-16C Programing
Message #7 Posted by GWB on 5 Apr 2005, 6:13 p.m.,
in response to message #1 by Trent Moseley

INT:

f RR f RL

FRAC:

ENTER f RR f RL -

(If you want INT to work with negative arguments, change it to this:

ENTER g ABS / g LSTx g ABS f RR f RL * )

Try them and tell me if they work.

Regards,

Gerson

            
Re: HP-16C Programing
Message #8 Posted by Trent Moseley on 5 Apr 2005, 7:48 p.m.,
in response to message #7 by GWB

Gerson,

Your keystrokes don't seen to work on by machine.

tm

                  
Re: HP-16C Programing
Message #9 Posted by GWB on 5 Apr 2005, 8:27 p.m.,
in response to message #8 by Trent Moseley

Thanks for the feedback.

I've tested it on Emmet Gray's WRPN (HP16C Simulator). Maybe that's not an exact simulator.

In fact, on another simulator

http://www.flounder.com/hp16c.htm

rotation instructions don't seem to work in float mode, what I suppose is the behavior of the real 16C. Sorry.

Gerson.

Edited: 5 Apr 2005, 8:50 p.m.

                        
Re: HP-16C Programing
Message #10 Posted by Vieira, Luiz C. (Brazil) on 6 Apr 2005, 3:20 a.m.,
in response to message #9 by GWB

Hi Gerson, guys;

Except for the four arithmetic basic ones (+, -, and ), the only arithmetic functions that work in floating point mode (actual HP16C) are square root and reciprocal (1/x). Also, number entry, stack manipulation and programming work as well. All of the integer-number related functions (bit manipulation, boolean operators, double-precision, etc.) are disabled in floating-point mode. If I am not worng, the only function disabled in integer mode operation is the reciprocal.

Cheers.

Luiz (Brazil)

Edited: 6 Apr 2005, 6:15 a.m.


[ Return to Index | Top of Index ]

Go back to the main exhibit hall