Log Library - How is it done in the library code?

Henry Spencer henry at zoo.toronto.edu
Thu Mar 14 02:38:41 AEST 1991


In article <1991Mar12.211047.826 at m.cs.uiuc.edu> joshi at m.cs.uiuc.edu (Anil Joshi) writes:
>All I needed was the info as to what is being done in the library
>routine so that I can emulate the library routine.   ... why I asked
>whether the code is available somewhere, so that I can make my
>program efficient and fast.

Unfortunately, you didn't really supply enough information for this.
There is no single source for the log function; the answer is vendor-
specific.  As a particular case in point, on a 68xxx machine with a
68881, the best log routine consists of (ignoring calling-sequence
overhead):

	FLOGN r1, r2

or the equivalent.  That's right, one instruction.  On most more modern
machines the sequence will be more complex. :-)  When you post such
queries, you need to supply details on things like machine, compiler,
and requirements.
-- 
"But this *is* the simplified version   | Henry Spencer @ U of Toronto Zoology
for the general public."     -S. Harris |  henry at zoo.toronto.edu  utzoo!henry



More information about the Comp.lang.c mailing list