--- title: "The Mysterious “DEF FN and FN” Functions" type: "article" slug: "the-mysterious-def-fn-and-fn-functions" url: "http://localhost/article/the-mysterious-def-fn-and-fn-functions/" markdown_url: "http://localhost/article/the-mysterious-def-fn-and-fn-functions.md" published_at: "2020-10-27T17:13:33+00:00" modified_at: "2026-08-04T12:48:48+00:00" featured_image: url: "http://localhost/wp-content/uploads/2022/04/20230809-041332.jpg" excerpt: "One Monday morning at the Timex Literature Department Mary was given a task that would normally been assigned to Gus, the Mathematician. Gus had his usual Monday morning problem. Now Mary majored in Greek Literature, not Greek Mathematics symbols. But, never the less, Mary was given the task of writing the part of Appendix A…" category: - name: "Update Magazine" slug: "update-magazine" taxonomy: "category" url: "http://localhost/category/periodicals/update-magazine/" post_tag: - name: "Best of Timex/Sinclair 2068 Articles and Documents" slug: "ts2068best" taxonomy: "post_tag" url: "http://localhost/tag/ts2068best/" - name: "TS 2068" slug: "ts2068" taxonomy: "post_tag" url: "http://localhost/tag/ts2068/" - name: "Type-in program" slug: "type-in-program" taxonomy: "post_tag" url: "http://localhost/tag/type-in-program/" model: - name: "Timex/Sinclair 2068" slug: "ts-2068" taxonomy: "model" url: "http://localhost/model/ts-2068/" publication: "TS-2068 Up-date" publication_r: id: 10283 title: "Update Magazine" type: "periodical" url: "http://localhost/periodical/update-magazine/" authors_r: - name: "Bill Jones" slug: "bill-jones" taxonomy: "indiv" url: "http://localhost/indiv/bill-jones/" issues_articles: - id: 26483 title: "Update April 1988" type: "issue" url: "http://localhost/issue/ts-2068-up-date-april-1988-2/" pages: "22-23" pubdate: "April 1988" archive_link: false volumeissue: "v1n3" --- # The Mysterious “DEF FN and FN” Functions One Monday morning at the Timex Literature Department Mary was given a task that would normally been assigned to Gus, the Mathematician. Gus had his usual Monday morning problem. Now Mary majored in Greek Literature, not Greek Mathematics symbols. But, never the less, Mary was given the task of writing the part of Appendix A of the TS-2068 User Manual to explain such functions as ABS, ACS, ATN, “DEF FN”, and “FN”. Thus explains the reason why many TS-2068 users have not ever used the DEF FN and FN functions. The User Manual has good prose, but lacks some in detail. The two functions DEF FN and FN are used together like bread and butter to store MATH FORMULAS in memory and then SOLVE the problems by INPUT of the missing factor. Take for example the formula C=PI*D for solving the circumference of a circle when d (diameter) is known. To set the formula into memory, a line of programming would define the formula as, `DEF FN c(m)=PI*d`. Or, to convert METERS to INCHES, the formula I=39.37*M would be defined in a program line as, `DEF FN i(m)=39.37*m`. The formula is in the DEF FN structure, and the SOLUTION is achieved by using the FN function, as `PRINT FN i(m)`, or `LET a= FN i(m)`, to assign to a variable. The following little program demonstrates one way of using the DEF FN and FN functions. ``` 1 REM ** Using DEF FN and FN ** 10 PRINT "Convert Meters to Inches" 20 DEF FN i(m)=39.37*m 30 INPUT "Diameter in Meters? ";m 40 PRINT FN i(m) 50 LET d= FN i(m) 60 PRINT "Compute Circumference" 70 DEF FN c(m)= PI *d 80 PRINT FN c(m) ``` SYNTAX: DEF FN is followed by a identifier, “i” in the first case, and “c” in the second case. Then the designator letter is inclosed (m). This also can be any letter. On the right side of “=” comes the formula to be solved. The un-known factor in the formula, “m” in the first case, and “d” in the second case, are fed into the formula by INPUT prompt. Line 40 gets the value computed with the “PRINT FN i(m)”. Line 50 demonstrates that the FN solution may be directly assigned to a variable. This value of d is used in the second formula to compute the circumference of a circle. The DEF FN formulas may be placed in a line of programming to be initialized as one initializes a variables table (with GO SUB line #). The DEF FN formulas need not be repeated once they are initialized. Variable Not Found report will result if there are insufficient inputs for the formula to be solved.