Log Library - How is it done in the library c

Dave P. Schaumann dave at cs.arizona.edu
Wed Mar 13 06:35:24 AEST 1991


In article <2063 at gold.gvg.tek.com> shaunc at gold.gvg.tek.com (Shaun Case) writes:
>Just as a point of minor interest, you can get the exponent of the log
>of a string representation of a positive integer by doing a strlen().
>(log base 10, of course.)
>
>Example:
>strlen("1") -1 ==   0   log == 0
>[...]
>Now, if we could only use strupr() to calculate sin and cos...
>:-)

Actually, if you're willing to tolerate the same range of error (+/- 1),
you can define sin(x) == cos(x) == 0.
-- 
Dave Schaumann | dave at cs.arizona.edu | Short .sig's rule!



More information about the Comp.lang.c mailing list