Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Portable Math Library in C (Part 0 of 6)

17 views
Skip to first unread message

f...@mcdsun.uucp

unread,
Apr 10, 1987, 7:38:11 PM4/10/87
to

This is a portable math library written entirely in C. Since it has been
several years since I had any interest in doing any more work on it, and
people may find it useful, I have decided to post it. There should be
a lead-in posting (part 0 of 6?) containing a README file and commands
to make the directories for the regular parts 1-6. Be sure to read the
README file in 'part 0'.

-Fred Fish

=============== Cut here and feed to the shell ========================

#! /bin/sh
# This is a shell archive. Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file". To overwrite existing
# files, type "sh file -c". You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g.. If this archive is complete, you
# will see the following message at the end:
# "End of archive 1 (of 1)."
# Contents: README doc funcs funcs/doc funcs/environ funcs/src
# funcs/src/unused funcs/unused tests tests/unused
# Wrapped by fnf@mcdsun on Fri Apr 10 16:21:17 1987
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f README -a "${1}" != "-c" ; then
echo shar: Will not over-write existing file \"README\"
else
echo shar: Extracting \"README\" \(3902 characters\)
sed "s/^X//" >README <<'END_OF_README'
X
XThe original version of pml (Portable Math Library) was written several
Xyears ago, when I was just learning C and trying to switch most of my work
Xfor engineering classes from Fortran to C. I quickly ran into problems
Xwith portability, missing functions, compiler bugs, etc, etc, etc.
XConsidering I was using some pretty primitive stuff at the time, it's a
Xwonder anything worked! Anyway, pml came about from pressures to get
Xsomething that would work in a number of environments and also as a learning
Xtool as to how floating point libraries worked. I don't claim to be a
Xnumerical analyst, then or now, but I did learn a lot writing this stuff
X(including how to write in C).
X
XSeveral times I have started to go back and redo the library to use
Xnewer C features, make it compatible with the Unix version, etc. For
Xexample, the original C compilers I had access to could not pass structures,
Xjust pointers to structures, which made for some pretty ugly code. Changing
Xthe code to pass a 'complex' structure cleaned it up a lot. Given
Xseveral aborted attempts to redo the whole thing (aborted due to lack
Xof motivation and/or time), it's now in somewhat of a mess, and probably
Xinconsistent in several areas. Still, someone might find it useful, or
Xeven be motivated enough to carry on with it, given this code as a base.
X
XSo, in the hopes that someone will 'adopt' pml, and make it their pet,
XI've decided to post my most current code, and relinquish all rights to
Xit. I.E., make it truly public domain, rather than simply freely
Xredistributable.
X
XHints for adoptive parents:
X
X 1. Much of the documentation and internal comments
X is now either wrong, misleading, or both. Beware.
X
X 2. Most C functions use pieces from various iterations
X of my macro based debugging package. For example,
X the LEAVE() macro hasn't been used directly in years...
X You should either chuck this stuff wholesale, or
X convert it to use my latest version (posted on the
X net some months ago).
X
X 3. The implementation of functions like 'inverse complex
X hyperbolic arccosine' may very well be numerically
X naive.
X
X 4. This is your baby now, don't ask me how to change its
X diapers. I wouldn't mind getting pictures now and then
X though. :-) :-)
X
XBelow is the original README file, for reference.
X
X Fred Fish
X 10-Apr-87
X
X======================================================================
X
XPML --- Portable Math Library for C programs.
X
XThis directory contains the PML math library distribution.
XSince it is intended to be a highly portable library, useful
Xon a wide variety of machines, no installation command files
Xare provided. It is assumed that the installer is sufficiently
Xknowledgeable to successfully install the library given the
Xfollowing general guidelines:
X
X(1) The constants in "pml.h" must be suitably defined for
X the environment in which the library is to be used.
X
X(2) The appropriate environment #define variable is
X defined somewhere, either within the preprocessor
X itself, in <stdio.h>, is added to "pml.h", or
X is included on the compiler invocation command
X line.
X
X For example, "#define PDP10" or "#define pdp11".
X
X(3) The file "pmluser.h" is moved to the global header
X file directory, so that an "#include <pmluser.h>"
X will be properly processed.
X
X(4) All of the library source files are compiled.
X
X(5) The furnished test routines are compiled, linked
X with the library routines, and executed.
X
XThis library currently runs essentially unchanged on a wide
Xvariety of machines, under a wide variety of operating systems.
XKnown installations include PDP-11s running RSX-11M and using
Xthe DECUS C system, DECSYSTEM-20 running TOPS-20 using an
XMIT C compiler, Callan Data Systems 68000 system running
XUniplus (Unix port from Unisoft), and an IBM Personal
XComputer running PC-DOS using a CII C compiler. If you
Xknow of any others, please let me know.
X
X Fred Fish
X
END_OF_README
if test 3902 -ne `wc -c <README`; then
echo shar: \"README\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test ! -d doc ; then
echo shar: Creating directory \"doc\"
mkdir doc
fi
if test ! -d funcs ; then
echo shar: Creating directory \"funcs\"
mkdir funcs
fi
if test ! -d funcs/doc ; then
echo shar: Creating directory \"funcs/doc\"
mkdir funcs/doc
fi
if test ! -d funcs/environ ; then
echo shar: Creating directory \"funcs/environ\"
mkdir funcs/environ
fi
if test ! -d funcs/src ; then
echo shar: Creating directory \"funcs/src\"
mkdir funcs/src
fi
if test ! -d funcs/src/unused ; then
echo shar: Creating directory \"funcs/src/unused\"
mkdir funcs/src/unused
fi
if test ! -d funcs/unused ; then
echo shar: Creating directory \"funcs/unused\"
mkdir funcs/unused
fi
if test ! -d tests ; then
echo shar: Creating directory \"tests\"
mkdir tests
fi
if test ! -d tests/unused ; then
echo shar: Creating directory \"tests/unused\"
mkdir tests/unused
fi
echo shar: End of archive 1 \(of 1\).
cp /dev/null ark1isdone
MISSING=""
for I in 1 ; do
if test ! -f ark${I}isdone ; then
MISSING="${MISSING} ${I}"
fi
done
if test "${MISSING}" = "" ; then
echo You have unpacked all 1 archives.
rm -f ark[1-9]isdone
else
echo You still need to unpack the following archives:
echo " " ${MISSING}
fi
## End of shell archive.
exit 0
--
= Drug tests; just say *NO*! (Moto just announced new drug testing program) =
= Fred Fish Motorola Computer Division, 3013 S 52nd St, Tempe, Az 85282 USA =
= seismo!noao!mcdsun!fnf (602) 438-5976 =

0 new messages