-----Original Message----- From: Russell McMahon [mailto:apptech@PARADISE.NET.NZ] Sent: 03 October 2003 05:18 To: PICLIST@MITVMA.MIT.EDU Subject: Re: [pic]: square roots for the 18F FWIW, and you all may have better ways of doing this, square root can be used directly to build a log function using otherwise only shift and add. It may be that this information is more useful to people with a 4 function plus sqrt calculators who want a log function :-) eg using said calculator log10(X) ~= (sqrt.sqrt.sqrt.sqrt.sqrt.sqrt.sqrt.sqrt.(X) - 1 ) x 889 As you change the number of sqrts only the constant changes to get the right answer (subject to accuracy constraints) If this looks obscure try geting the answer for log2 with various sqrts and changing the constant. (Hint: Constant looks suyspiciously like 2^N ) Couldn't get this to work e.g.: LOG10(20) = 1.301 20 ('square rooted' 8 times) = 1.0117 (1.0117 - 1) * 889 = 10.46 What am I doing wrong? I suspect I am interpreting the sqrt.sqrt.sqrt etc. operation wrongly. Mike ======================================================================= This e-mail is intended for the person it is addressed to only. The information contained in it may be confidential and/or protected by law. If you are not the intended recipient of this message, you must not make any use of this information, or copy or show it to any person. Please contact us immediately to tell us that you have received this e-mail, and return the original to us. Any use, forwarding, printing or copying of this message is strictly prohibited. No part of this message can be considered a request for goods or services. ======================================================================= Any questions about Bookham's E-Mail service should be directed to postmaster@bookham.com. -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu