'---------------------------------------------------------------------------------------- ' Name: EXP_REAL.TIG ' Type: TIGER-BASIC(tm) Source Code ' Purpose: Creating the EXP function for a floating point base and ' exponent, based on the term: a^x = e^(x*ln(a)) ' ' (C) - Copyright Wilke Technology, P.O.Box 1727, D-52018 Aachen, Germany '---------------------------------------------------------------------------------------- ' ' Thank you for using BASIC Tigers in your products. If you have questions, ideas ' or special needs, please contact your next distributor or the Tiger support team ' and visit our web site: ' ' Wilke Technology GmbH ' The Tiger Support Team ' P.O.Box 1727, D-52018 Aachen, Germany ' Krefelder Str. 147, D-52070 Aachen, Germany ' ' email: support@wilke-technology.com (english) ' email: support@wilke.de (german) ' Phone: +49 (241) 918 900 Mo to Fr, 7:00 to 16:00 (GMT) ' Fax: +49 (241) 918 9068 ' ' New information, new drivers and free downloads see: ' ' www.wilke-technology.com (english) ' www.wilke.de (german) ' ' Sincerely, ' ' Your Tiger Support Team ' '---------------------------------------------------------------------------------------- ' ' The exponential functions of Tiger-BASIC are only suited for fixed point values, e.g. ' 16^4, 2^20 etc. If you need to calculate a product where base and exponent consist of ' floating point values, you can use the subroutine EXP_REAL: ' ' CALL EXP_REAL (f, b, e) ' ' where ' - f is the function value which gets calculated by the subroutine, ' - b is the value for the base and ' - e is the value for the exponent. ' '---------------------------------------------------------------------------------------- TASK MAIN ' begin task MAIN REAL k, T, x, fT ' declare REAL variables INSTALL_DEVICE #1, "LCD1.TDD" ' install LCD driver USING "NF<0><1> <9>V0.0.0.0.0.0.0.0,0.0.0.0.0.0.0.0" ' string for formatted output k = 26.4 ' value for base T = 2.65 ' value for exponent CALL EXP_REAL (fT, k, T) ' call calculation of fT = k^T PRINT_USING #1, "<1> k:"; k ' display base PRINT_USING #1, " T:"; T ' display exponent PRINT_USING #1, "fT:"; fT ' display product END ' ende of task MAIN '---------------------------------------------------------------------------------------- ' Subroutine for floating point exponential function using a^x = e^(x*ln(a)) '---------------------------------------------------------------------------------------- SUB EXP_REAL (VAR REAL f; REAL b, e) ' begin subroutine EXP_REAL REAL x ' declare REAL variable for new exponent x = e * LN(b) ' determine new exponent f = EXPE(x) ' result = exponent to base e END ' end of subroutine EXP_REAL