I found a neat approximation for an arctangent in radians of a value of X in [-1,1]: atan(X) = X / { 1 + 0.28 X*X } error < 0.005 If I use 8-bit fixed point, then the denominator will require 9 bits, which creates an annoying problem with the division. I see several solutions to the problem. 1. I can shift the denominator one bit to the right, creating a temporary 8 bit result, doing the division, and then shifting the quoteient one bit to the right to compensate. Sort of a limited floating point. 2. Do a 32 bit by 16 bit division, and then convert to an 8-bit answer. Does anyone have experience with the best way to deal with this type of precision issue? Thanks. ================================================================ Robert A. LaBudde, PhD, PAS, Dpl. ACAFS e-mail: ral@lcfltd.com Least Cost Formulations, Ltd. URL: http://lcfltd.com/ 824 Timberlake Drive Tel: 757-467-0954 Virginia Beach, VA 23464-3239 Fax: 757-467-2947 "Vere scire est per causas scire" ================================================================ -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist