[comp.sys.handhelds] HP 32SII Fractions

sjthomas@cup.portal.com (Stephen J Thomas) (04/30/91)

                         MORE FRACTIONS ON THE HP 32SII

     I have to agree with Joe Horn in his enthusiasm for the fraction 
     package in the 32SII.  It is a substantial improvement over fraction 
     implementation on other calculators.  However, there are a couple of 
     problems in the fraction system. 

     But first, for those who have not played with fractions on the 32SII, 
     here are a few basics: 

     As has been reported here several times, fraction entry is normally 
     done via the [.] key, which is used to separate any integer portion 
     from the numerator, and to separate the numerator from the 
     denominator.  For instance, to enter 1 3/5, press 1.3.5.  The display 
     shows normal fraction format, and automatically changes improper 
     fractions to an integer plus proper fraction display.  To enter 
     fractions with no integer portion, such as 4/5, you can enter either 
     .4.5 or 4..5 . 

     The FDISP function toggles fraction display mode (and flag 7) with the 
     standard decimal display mode (FIX, SCI, ENG or ALL).  If you are in a 
     decimal mode and execute FDISP, the current x-register value is 
     displayed as a fraction. 

     The display uses up [^] and down [v] arrow annunciators to indicate
     if the actual x-register value is greater or less than the displayed 
     fraction. 

     You can enter any denominator with 4 or fewer digits.  If your 
     denominator is greater than 4095 (which is the default denominator), 
     the fraction is changed to the closest fraction with a denominator 
     less than or equal to 4095.  The integer portion and the numerator 
     together must comprise no more than 12 digits. 

     The /c function is used to establish the maximum desired denominator.
     It's actual interpretation is subject to the current fraction format, 
     which is controlled by flags 8 and 9:

     o MOST PRECISE FRACTION (CF 8):  The default format.  Fractions are 
     reduced as much as possible, with any denominator up to the /c value.

     o FACTORS OF DENOMINATOR (SF 8, CF 9):  Fractions are reduced as much 
     as possible, and the denominator is a factor of the /c value.  So if 
     the /c value is 16, the possible denominators are 2, 4, 8 and 16.

     o FIXED DENOMINATOR (SF 8, SF 9):  Fractions are not reduced (except 
     to display improper fractions as proper fractions), and the 
     denominator is the /c value.



     Now, some of the problems with the fraction package.


     #1:  The "Factors of Denominator" mode sometimes produces denominators 
          which are not factors.  In these cases, the 32SII seems to 
          display the "Most Precise Mode" fraction, so this is a minor bug. 

             Example: SF  8
                      CF  9
                      8  /c
                      3  1/x       See 0 1/3; but 3 isn't a factor of 8


     #2:  The "Fixed Denominator" mode (SF 8, SF 9) sometimes produces 
          denominators other than the specified one, along with incorrect 
          numerators.  The amount of the error can be about +/- 1.  HP is 
          now sending a manual addendum recommending that Flag 9 not be 
          used at all.  

             Example: SF  8 
                      SF  9
                      1  ENTER  ENTER  ENTER
                      8  /c
                      32  1/x        (which is 0.03125)
                          See v 0 7/8  (which is 0.875)
                          We should see ^ 0 0/8 
                          (recall ^ and v are the up- and down-arrows.)

                      Now press +  repeatedly.  You'll see:
                      v 1 7/8
                      v 2 1/2
                      v 4
                      v 4 3/4
                      v 5 3/5
                      v 6 1/2
                      v 7 3/7
                        etc...  all of which are WAY off, and very few of
                                which have a "fixed" denominator of 8.



     #3:  The "Most Precise" mode (CF 8, CF 9) and the "Factors of 
          Denominator" mode (SF 8, CF 9) sometimes violate the 
          commutativity of addition, and produce incorrect results.  This 
          only occurs when the x value is close to 1/8 of the /c value, and 
          the last two digits of the LASTx register's exponent are nonzero.  
          The worst error this can produce is approximately +/- 0.125, 
          which makes this a substantial bug. 

             Example: CF 8
                      CF 9
                      8  /c
                      32  1/x        See v 1/8;  should be ^ 0 0/8
                      Pressing  0  + gives ^ 0, but  
                            32  1/x  0  X<->Y  +   gives   v 0 1/8 
                      Addition should be commutative.
                      The LASTx value is causing the problems.



     In late March, I called HP's Technical Support department about 
     problems with the fraction system (actually, at that time, I only knew 
     about bug #1).  The HP employee stated that the 32SII can give 
     incorrect answers when using fractions (although she would not go into 
     any details about what problems were known), and that HP would likely 
     be instituting some type of exchange program this summer.  She 
     suggested I call back after April 1 for details.  I did call back, 
     left a message, and haven't heard back from them yet.  I suppose I'll 
     try again after May 1. 

     Stephen J Thomas    sjthomas@cup.portal.com
     "I'll get by with a little help from my friends."

     "Sir, I protest!  I am NOT a merry man!"  --Worf