17bii unit conversions


Has anybody found any clever solver tricks for the 17bii that allow making unit converters that work like on the 19bii? By that I mean, store your input unit, then solve for any desired output unit. I'm sure there are plenty of L(), G(), and S() tricks I haven't fully explored yet.


Here's one from about six months ago.


Thanks Don!


That looks pretty close to the technique I've used before, but it looks like it's limited to converting between mm and in, or m and ft, or km and mi. So there's no way to go from, say, in to km.

I'd like to get as close to the 19bii unit converter as possible, so you could enter any one of mm, in, m, ft, km, or mi, and then solve for any one of the remaining five.

I've got an idea that I think I'll tinker with on my 200LX, since that's a bit easier for typing out long formulas.


Dave, I think I see what you want. It may be possible, but you will have to check and see which value was entered so you can convert from that to what you want, and if you do a conversion after that there will be two values already present, so you'll have to figure out what to do in that situation (maybe that's OK, just convert from either of the two).

I'll play with this tonight when I get home.


This is what I tried so far (on my 200LX, so the syntax and formatting will be a tiny bit different). It doesn't seem to behave as desired, though.


The idea would be to do Clear Data, store the value into the appropriate starting unit, then immediately solve for that unit. That will convert it to cm and store that value in cm. (The variable i is used to indicate if the solver has been initialized.) Then you would be able to pick any of the other units in the formula, and it will convert them from cm.

I suspect something is going wrong with setting val on the left side, and stuffing it into cm on the right side. When I clear the solver, store a value into mm, and solve for mm, it just zeros out mm, cm, and val, and sets i to 1. If I remove '*L(i:1)' from the right side to prevent initializing i, it initializes cm properly, but then you can't solve for the other units.


Dave, this would be my approach. I only took it as far as 3 units: IN, FT, and MI, but it could be extended to include the other three units as well. You would have to Clear Data between calculations:



This almost works, but it seems to behave unpredictably (at least on my 200LX):


The idea is to load 'val' with whatever value is in the variable being solved for, and then if 'i' is zero (i.e. it's the first "run"), load 'val' into 'i'. Subsequent runs then use this value that was stored in 'i' (which in this case, would be the length normalized to cm). This actually seems to be working most of the time.

But for some reason, if I do Clear Data, I can't reinitialize using the same variable/unit I just solved for. It'll just zero it out. The sequence looks something like this:

"mm = 18"
"mm = 18" ('i' gets set here)
"cm = 1.8"
[Clear Data]
"cm = 15"
"cm = 0" ('i' stays at zero)

Not totally sure what's going on here. I'll have to try it on my 17bii and 19bii tonight.


Dave, I entered your equation on my 17bii and got these results:

clear data
"mm = 18"
"mm = 0"
"cm = 0"

You are blazing new territory here. I have to admit I don't understand exactly what your equation is doing. I haven't tried it on my 19b but I expect the results would be the same.


Yeah, just tried it on my 19bii and 17bii. Didn't work on either of them. The variables 'val' and 'i' never get set. Back to the drawing board.


Hi Dave & Don,

This is a very interesting solve problem. Looks simple, but is a lot deeper than it looks. My first few tries were trying to enter FEET into FT and then press a second time, but no matter what I tried, the solver would always zero feet out.

The work around was to use a dummy variable X. The following listing is from the CPACK200 program, but should work on a real HP-17BII.

0* L( IN:FT* 12) +
0* L( KM:MILE*1.60934)+
IF (S(FT):

Takes two steps to do a conversion:

To convert Miles to FT, IN, KM, and M, enter the miles into X and then press MILES key to do the conversion. Results are in each of the variables.

Likewise for Inches, enter inches into X and then press IN key.

The routine could be expanded to do the remaining units.



Hmm, interesting, if a bit "wordy". I'll have to play with that and see if there's a way to do it without entering the conversion factors twice. I have an idea, but it might be too crazy to work (like my last attempt). :)


Alright, this works on my 19bii, but there are two problems with it.

1. It's kind of slow.

2. It's completely insane.

I'll try to add some C-style inline comments, since it's not obvious what's going on here.

//Throwaway values (all the L() magic happens in here).
//Store the proper conversion factor in F, and temp CM value in V
//Put value from V into CM on first run
//Choose the correct equation based on what variable to solve for.
//Moving the -G(CM) outside the IF breaks it for some reason.

But it works! All you do is Clear Data, store your starting unit, then immediately solve for that same unit. You'll get the same value back. Then if you solve for any other variable, you'll get the amount converted to that unit.

Possibly Related Threads...
Thread Author Replies Views Last Post
  17BII & 17BII+ Discounted Payback Period Revisited Tom Neudorfl 8 2,350 11-25-2013, 10:28 AM
Last Post: Don Shepherd
  Interesting Base Conversions - Porting a 1975 HP 25 Program to the HP 35S Eddie W. Shore 1 1,137 10-13-2013, 07:49 PM
Last Post: BruceH
  Unit circle on HP Prime Mic 2 1,071 08-28-2013, 05:22 PM
Last Post: Thomas Klemm
  Decimal/Binary Conversions for the HP 39gii - 3/16/2013 Eddie W. Shore 0 794 03-16-2013, 04:30 PM
Last Post: Eddie W. Shore
  Unit conversions inside programs on 50g Chris Smith 2 1,056 02-23-2013, 05:35 AM
Last Post: Chris Smith
  WP 34S adding own conversions Lourensk 4 1,287 03-24-2012, 02:45 PM
Last Post: Walter B
  Re: Voyager 1xC emulation in the same unit? uhmgawa 4 1,876 01-24-2012, 01:09 AM
Last Post: uhmgawa
  Dave Ramsey et al with early HP 41C conversions to CL Geoff Quickfall 4 1,499 01-01-2012, 12:51 AM
Last Post: David Ramsey
  Google onlinecalculator conversions etc. designnut 2 948 08-18-2011, 09:23 AM
Last Post: snaggs
  Wp34s unit conversions Cristian Arezzini 4 1,285 07-25-2011, 05:02 AM
Last Post: Paul Dale

Forum Jump: