Contents Links Search
 

RPN Scripts

RPN Documentation

Submit Script

Conversion
   Conversions
   Convert
   Euro
   Euro_Calculator
   Soundex
Engineering
   Feet_&_Inch
   Units
   Water
Entertainment
   Master_Mind
   Sticks!
Finance
   Annuity
   Euro_Calculator
   TVM_Financial_Functions
Math
   3D_Vectors_v1.2
   Base
   Base_Conversions
   Complex_Arithmetic
   Complex_Math
   Discrete_Math
   EBBases
   Fractions
   Fractions
   Least
   Logs_&_Powers
   Misc
   Regressions
   Scientific
   Scientific_Functions
   Scientific_Programmable
   Simple_Complex_Math
   Standard_Normal_Distribution
   Trig
Misc
   Health
   Husband's_Calculator
Physics
   Angle_of_View
   Depth_of_Field
   Physics_Functions
Time
   Clock
   Julian
   Multiple_Timer
   Stop5Watch
   Stopwatch
   Timer
Utility
   Board_Foot_Calculator
   Calendar_Functions
   Checkbook_II
   MiniG
   Stack_Handling_and_Saving
   WindChill

Feet & Inch
Jim Cook - email


summary
Do arithmetic using feet/inches

instructions
This script provides the ability to add feet and
inches. Two different number formats are provided.
Either type f.iinndd or fii.nndd where f is the
number of feet, ii is the number of inches, nn is
the numerator, and dd is the denominator. For
example, five feet, eight and one-half inches is
5.080102 in the first format and 508.0102 in the
second format.

Feet & Inch lets you add two measurements, or
find the difference between two measurements, as
well as the ability to multiply or divide a
measurement by a number.

This version is longer than a standard clipboard
can hold. I use cliphack to copy it to RPN.

code
RPN.2.a \ Feet & Inch
[h]g1 w r2 f m50m02;
[s]#'100'/ChChChChChd1;
[d] g10=0 (0 : #'64' V { g1 H f 0 =0 (:B) H vHV } v );
[f]  { g1 0< (#'64'+r21-r2:B) }  { g1 #'63' > (#'64'-r21+r2:B) } Cd 
#'100'/+ #'100'/ r2  #'.5'+w g1 #'12' / #'.05'+ w r2 #'12' % 
xa (  r2 m50m02 ++:  #'100' / + r2 #'100' / +);
[t] Cs  xa (d1#'64' r2 g1 0=0 (d11:)/ *r3m12r3 + r2:#'64' r2 g1 0=0 
(d11:)/ * r4 m50m02 r4 + m12 r3 + r2);
"Feet & Inch";
"Feet & Inch:Show the version" D'Feet & Inch Version 2.03\Jim 
Cook|email|Ok|' ( : D'jcook@halcyon.com|Ok|' d1) ;
~
"+:Add two f&i numbers"?2 Ct r3 Ct r3 +k3 + r2 Cf;
"-:Subtract two f&i numbers" ?2  Ct r3 Ct r3 -k3 r2- g10< (nr2n:r2) Cf;
"*:Multiply f&i by a standard\ number" ?2 r2 Ct g3 * k3 * g1 w r2 f m64  
r3 +  #'.5'+w Cf;
"÷:Divide f&i by a standard\number" ?2  r2 Ct  g3 / k3 r2 / g1 w r2 f 
m64  r3 +  #'.5'+w Cf;
~
"_f&i->n: Convert from f&i\format to a standard number"?1Ct #'64' /+;
"_n->f&i: Convert a standard\number to f&i format" ?1 g1 w r2 f m64 
#'.5'+w Cf;
~
"Select format: How numbers\are shown. 1 foot 2 and 3/4\is either 
102.0304 or 1.020304" D'Do you want to use feet.inches\or 
inches.parts?|f.iinndd|fii.nndd|Cancel|' g1 2<(Xa:d1);

top
Nth Lab
©1996 - 2001 all rights reserved
August 03, 2001
contact