Section 3: Functions43

Conversions

The conversions are listed in Figure 3-2. The conversions all expect an input value in the X-register and leave the result there. Note that angle conversions are given in Figure 3-1.
Sample Case: Octal/Decimal Conversions. Many computers are designed to work with octal (base 8) numbers instead of decimal (base 10) numbers. The  OCT function on your HP-65 allows you to make octal/decimal conversions with ease. For example, find the octal equivalent of the decimal number 512.
Press   See Displayed   Comment
512 f OCT  
  1000.00
  Octal representation of 51210.
Convert the octal number 2000 to its decimal equivalent:
2000 f-1 OCT  
  1024.00
  Decimal equivalent of 20008.
Sample Case: Truncating at Decimal Point. The Personal Investment Program (presented in the Introduction) expects you to key in the dates using the format mm.yyyy. The program separates mm from yyyy using the truncation functions. Do the same for the date 12.1980.
Press   See Displayed   Comment
DSP    4        
12.1980  
  12.1980
   
fINT   
  12.0000
  Answer: integer part.
gLSTX   
  12.1980
  Recall original value.
f-1INT   
  0.1980
  Answer: fractional part.
DSP    2  
  0.20
  Reset display to two places.
Sample Case: Absolute Value. Some Calculations require the magnitude of a number. To get this from the keyboard, you could observe the number and change the sign if negative (using CHS).