# to the n-th power
Andre Dolenc
ado at sauna.hut.fi
Tue Nov 6 00:52:12 AEST 1990
(1) Since my last posting I have learned that the source code to the
math functions (libm) of 4.3 BSD are publicly available and may
be obtained by anon. ftp from several sites, eg.
funic.funet.fi in ~ft/pub/unix/bsd-sources/src/usr.lib/libm
which is a copy of an anon. ftp directory in uunet.uu.net.
Read the copyright notice before using them.
(2) Looking into "pow" one learns that to figure out if "y"
in "pow(x,y)" is an integer is reduced to:
t=drem(x,two);
if ((t == zero) || (copysign(t,one) == one)) then "y is int".
Now, the code which implements "drem" is not trivial. Therefore,
I withdraw my question "How do we decide if y is an integer?".
(3) My previous posting contains (at least) one error. The multiple
precision function "pow" is defined under SunOs in "misc. lib
functions", MP(3X), *not* under Ultrix.
The problem is that the name obviously conflicts with the math
function "double pow(double x, double y)". Isn't dum to have
2 (system) library functions with the same name?
In the hope of not having wasted too much bandwidth,
----------------------------------------------------------------------------
Andre' Dolenc Helsinki University of Technology
Research Associate TKO, Otakaari 1A, Espoo
Email (Internet): ado at sauna.hut.fi SF-02150 Finland
----------------------------------------------------------------------------
More information about the Comp.lang.c
mailing list