Need to convert FIF49 to Prime version
06-24-2018, 03:38 PM (This post was last modified: 06-24-2018 04:03 PM by DrD.)
Post: #18
 DrD Senior Member Posts: 1,132 Joined: Feb 2014
RE: Need to convert FIF49 to Prime version
Thats cool!
You might like to keep the units and fraction format:

Code:
 // Enter list of feet, inches, fractional inches AND architectural precision! EXPORT FIF(m,a) BEGIN   LOCAL res := {0,0,0};   LOCAL in;   in := ΣLIST(m * {12,1,1});   res(1) := IP(in/12);   res(2) := IP(in MOD 12);   res(3) := ROUND(FP(in)*a,0)/a;  //  Adjust for architectural units    RETURN exact(res * {1_(ft),1_(inch),1_(inch)}); // Return with units and fractions END;

Shortened version:

Code:
 //                                 From BruceH on MoHPC //                         modified for architectural fraction // //                                     FIF(m,a) //                                    6/24/2018 //                                       drd // // INPUTS:  Use 3 element list to represent feet, inches and fractions of inches. // // A 15' 9-1/2" wall is to have three 14-5/8" windows installed equally spaced. What is the horizontal space between the windows?  // To solve the problem you multiply the window width times three, subtract the total window width from the wall length, then // divide the space remaining by four. // // The full windows-in-wall example can be calculated as: ({15,9,1/2}-3*{0,14,5/8})/4 -> {3.75,-8.25,-0.34375} and then FIF(Ans) -> {3, 0, 13/32} // For example, the 15' 9-1/2" wall from earlier is entered as {15,9,1/2} (which displays as {15,9,0.5} but pressing [a b/c] turns the 0.5 back to a fraction). // Addition, subtraction and multiplication by a constant work as expected e.g. '3 * {0,14,5/8}' gives {0,42,1.875} This function FIF(m,a) does this // Enter list of feet, inches, fractional inches AND architectural precision! EXPORT FIF(m,a) BEGIN   LOCAL in;   in := ΣLIST(m * {12,1,1});   RETURN exact({IP(in/12),IP(in MOD 12),ROUND(FP(in)*a,0)/a} * {1_(ft),1_(inch),1_(inch)}); //  Adjust for architectural fraction END;

[attachment=6027]
-Dale-
 « Next Oldest | Next Newest »

 Messages In This Thread Need to convert FIF49 to Prime version - Mikebike - 06-16-2018, 02:23 PM RE: Need to convert FIF49 to Prime version - Eddie W. Shore - 06-18-2018, 12:51 PM RE: Need to convert FIF49 to Prime version - Mikebike - 06-18-2018, 02:16 PM RE: Need to convert FIF49 to Prime version - grsbanks - 06-18-2018, 03:27 PM RE: Need to convert FIF49 to Prime version - Joe Horn - 06-18-2018, 03:29 PM RE: Need to convert FIF49 to Prime version - DavidM - 06-18-2018, 03:42 PM RE: Need to convert FIF49 to Prime version - Eddie W. Shore - 06-21-2018, 12:35 PM RE: Need to convert FIF49 to Prime version - Mikebike - 06-21-2018, 01:03 PM RE: Need to convert FIF49 to Prime version - Eddie W. Shore - 06-21-2018, 07:49 PM RE: Need to convert FIF49 to Prime version - Mikebike - 06-22-2018, 01:58 AM RE: Need to convert FIF49 to Prime version - grsbanks - 06-22-2018, 06:39 AM RE: Need to convert FIF49 to Prime version - Stevetuc - 06-22-2018, 07:02 AM RE: Need to convert FIF49 to Prime version - DrD - 06-22-2018, 10:57 AM RE: Need to convert FIF49 to Prime version - Mikebike - 06-22-2018, 12:19 PM RE: Need to convert FIF49 to Prime version - Eddie W. Shore - 06-22-2018, 01:07 PM RE: Need to convert FIF49 to Prime version - DrD - 06-22-2018, 04:44 PM RE: Need to convert FIF49 to Prime version - BruceH - 06-24-2018, 01:37 PM RE: Need to convert FIF49 to Prime version - DrD - 06-24-2018 03:38 PM RE: Need to convert FIF49 to Prime version - Didier Lachieze - 06-24-2018, 04:41 PM RE: Need to convert FIF49 to Prime version - DrD - 06-24-2018, 06:31 PM RE: Need to convert FIF49 to Prime version - Didier Lachieze - 06-24-2018, 07:22 PM RE: Need to convert FIF49 to Prime version - Mikebike - 06-24-2018, 07:33 PM

User(s) browsing this thread: 1 Guest(s)