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

Portable Math Library (Part 1b of 6 REPOST)

22 views
Skip to first unread message

f...@mcdsun.uucp

unread,
Apr 29, 1987, 5:11:29 PM4/29/87
to

It appears that Part 1 of 6 of the pml posting was truncated or lost
because it exceeded 64000 characters; *NOT* 64K (???). Anyway, I've
split the contents up into two postings, Part 1a and Part 1b.

#! /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: funcs/src/ctan.c funcs/src/ctanh.c funcs/src/dabs.c
# funcs/src/log10.c funcs/src/matherr.c funcs/src/max.c
# funcs/src/min.c funcs/src/mod.c funcs/src/pmluser.h
# funcs/src/sign.c funcs/unused/frac.c tests/Makefile tests/c2d.dat
# tests/dd2d.dat tests/unused/d2i.dat tests/unused/di2d.dat
# Wrapped by fnf@mcdsun on Wed Apr 29 14:02:35 1987
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f funcs/src/ctan.c -a "${1}" != "-c" ; then
echo shar: Will not over-write existing file \"funcs/src/ctan.c\"
else
echo shar: Extracting \"funcs/src/ctan.c\" \(1942 characters\)
sed "s/^X//" >funcs/src/ctan.c <<'END_OF_funcs/src/ctan.c'
X/************************************************************************
X * *
X * N O T I C E *
X * *
X * Copyright Abandoned, 1987, Fred Fish *
X * *
X * This previously copyrighted work has been placed into the *
X * public domain by the author (Fred Fish) and may be freely used *
X * for any purpose, private or commercial. I would appreciate *
X * it, as a courtesy, if this notice is left in all copies and *
X * derivative works. Thank you, and enjoy... *
X * *
X * The author makes no warranty of any kind with respect to this *
X * product and explicitly disclaims any implied warranties of *
X * merchantability or fitness for any particular purpose. *
X * *
X ************************************************************************
X */
X
X
X/*
X * FUNCTION
X *
X * ctan complex double precision tangent
X *
X * KEY WORDS
X *
X * ctan
X * complex functions
X * machine independent functions
X * math libraries
X *
X * DESCRIPTION
X *
X * Computes double precision complex tangent of a double
X * precision complex argument.
X *
X * USAGE
X *
X * COMPLEX ctan (z)
X * COMPLEX z;
X *
X * PROGRAMMER
X *
X * Fred Fish
X * Tempe, Az 85281
X * (602) 966-8871
X *
X * INTERNALS
X *
X * Computes complex tangent of z = x + j y from:
X *
X * 1. Compute ccos(z)
X *
X * 2. If ccos(z) = 0 + j0 then the
X * result is MAX_POS_DBLF + j0
X *
X * 3. Else ctan(z) = csin(z) / ccos(z)
X *
X */
X
X#include <stdio.h>
X#include <pmluser.h>
X#include "pml.h"
X
X
XCOMPLEX ctan (z)
XCOMPLEX z;
X{
X COMPLEX ccosz;
X extern COMPLEX ccos (), csin (), cdiv ();
X
X ENTER ("ctan");
X DEBUG4 ("ctanin", "arg %le %le", z.real, z.imag);
X ccosz = ccos (z);
X if (ccosz.real == 0.0 && ccosz.imag == 0.0) {
X/*****
X z.real = MAX_POS_DBLF;
X******/
X z.real = 0.0; /* TERRIBLY WRONG! */
X z.imag = 0.0;
X } else {
X z = csin (z);
X z = cdiv (z, ccosz);
X }
X DEBUG4 ("ctanout", "result %le %le", z.real, z.imag);
X LEAVE ();
X return (z);
X}
END_OF_funcs/src/ctan.c
if test 1942 -ne `wc -c <funcs/src/ctan.c`; then
echo shar: \"funcs/src/ctan.c\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f funcs/src/ctanh.c -a "${1}" != "-c" ; then
echo shar: Will not over-write existing file \"funcs/src/ctanh.c\"
else
echo shar: Extracting \"funcs/src/ctanh.c\" \(1898 characters\)
sed "s/^X//" >funcs/src/ctanh.c <<'END_OF_funcs/src/ctanh.c'
X/************************************************************************
X * *
X * N O T I C E *
X * *
X * Copyright Abandoned, 1987, Fred Fish *
X * *
X * This previously copyrighted work has been placed into the *
X * public domain by the author (Fred Fish) and may be freely used *
X * for any purpose, private or commercial. I would appreciate *
X * it, as a courtesy, if this notice is left in all copies and *
X * derivative works. Thank you, and enjoy... *
X * *
X * The author makes no warranty of any kind with respect to this *
X * product and explicitly disclaims any implied warranties of *
X * merchantability or fitness for any particular purpose. *
X * *
X ************************************************************************
X */
X
X
X/*
X * FUNCTION
X *
X * ctanh complex double precision hyperbolic tangent
X *
X * KEY WORDS
X *
X * ctanh
X * complex functions
X * machine independent routines
X * math libraries
X *
X * DESCRIPTION
X *
X * Computes double precision complex hyperbolic tangent of
X * a double precision complex argument.
X *
X * USAGE
X *
X * COMPLEX ctanh (z)
X * COMPLEX z;
X *
X * PROGRAMMER
X *
X * Fred Fish
X * Tempe, Az 85281
X * (602) 966-8871
X *
X * INTERNALS
X *
X * Computes complex hyperbolic tangent of Z = x + j y from:
X *
X * ctanh(z) = (1 - cexp(-2z)) / (1 + cexp(-2z))
X *
X */
X
X#include <stdio.h>
X#include <pmluser.h>
X#include "pml.h"
X
X
XCOMPLEX ctanh (z)
XCOMPLEX z;
X{
X COMPLEX result;
X extern COMPLEX cexp (), cdiv ();
X
X ENTER ("ctanh");
X DEBUG4 ("ctanhin", "arg %le %le", z.real, z.imag);
X result.real = -2.0 * z.real;
X result.imag = -2.0 * z.imag;
X result = cexp (result);
X z.real = 1.0 - result.real;
X z.imag = -result.imag;
X result.real += 1.0;
X result = cdiv (z, result);
X DEBUG4 ("ctanhout", "result %le %le", result.real, result.imag);
X LEAVE ();
X return (result);
X}
END_OF_funcs/src/ctanh.c
if test 1898 -ne `wc -c <funcs/src/ctanh.c`; then
echo shar: \"funcs/src/ctanh.c\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f funcs/src/dabs.c -a "${1}" != "-c" ; then
echo shar: Will not over-write existing file \"funcs/src/dabs.c\"
else
echo shar: Extracting \"funcs/src/dabs.c\" \(1653 characters\)
sed "s/^X//" >funcs/src/dabs.c <<'END_OF_funcs/src/dabs.c'
X/************************************************************************
X * *
X * N O T I C E *
X * *
X * Copyright Abandoned, 1987, Fred Fish *
X * *
X * This previously copyrighted work has been placed into the *
X * public domain by the author (Fred Fish) and may be freely used *
X * for any purpose, private or commercial. I would appreciate *
X * it, as a courtesy, if this notice is left in all copies and *
X * derivative works. Thank you, and enjoy... *
X * *
X * The author makes no warranty of any kind with respect to this *
X * product and explicitly disclaims any implied warranties of *
X * merchantability or fitness for any particular purpose. *
X * *
X ************************************************************************
X */
X
X
X/*
X * FUNCTION
X *
X * dabs,fabs double precision absolute value
X *
X * KEY WORDS
X *
X * dabs
X * fabs
X * machine independent routines
X * math libraries
X *
X * DESCRIPTION
X *
X * Returns absolute value of double precision number.
X *
X * The fabs routine is supplied for compatibility with unix
X * libraries where for some bizarre reason, the double precision
X * absolute value routine is called fabs.
X *
X * USAGE
X *
X * double dabs (x)
X * double x;
X *
X * double fabs (x)
X * double x;
X *
X * PROGRAMMER
X *
X * Fred Fish
X *
X */
X
X#include <stdio.h>
X#include <pmluser.h>
X#include "pml.h"
X
Xstatic char funcname[] = "dabs";
X
X
Xdouble dabs (x)
Xdouble x;
X{
X DBUG_ENTER (funcname);
X DBUG_3 ("dabsin", "arg %le", x);
X if (x < 0.0) {
X x = -x;
X }
X DBUG_3 ("dabsout", "result %le", x);
X DBUG_RETURN (x);
X}
X
X
Xdouble fabs (x)
Xdouble x;
X{
X return (dabs(x));
X}
END_OF_funcs/src/dabs.c
if test 1653 -ne `wc -c <funcs/src/dabs.c`; then
echo shar: \"funcs/src/dabs.c\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f funcs/src/log10.c -a "${1}" != "-c" ; then
echo shar: Will not over-write existing file \"funcs/src/log10.c\"
else
echo shar: Extracting \"funcs/src/log10.c\" \(1744 characters\)
sed "s/^X//" >funcs/src/log10.c <<'END_OF_funcs/src/log10.c'
X/************************************************************************
X * *
X * N O T I C E *
X * *
X * Copyright Abandoned, 1987, Fred Fish *
X * *
X * This previously copyrighted work has been placed into the *
X * public domain by the author (Fred Fish) and may be freely used *
X * for any purpose, private or commercial. I would appreciate *
X * it, as a courtesy, if this notice is left in all copies and *
X * derivative works. Thank you, and enjoy... *
X * *
X * The author makes no warranty of any kind with respect to this *
X * product and explicitly disclaims any implied warranties of *
X * merchantability or fitness for any particular purpose. *
X * *
X ************************************************************************
X */
X
X
X/*
X * FUNCTION
X *
X * log10 double precision common log
X *
X * KEY WORDS
X *
X * log10
X * machine independent routines
X * math libraries
X *
X * DESCRIPTION
X *
X * Returns double precision common log of double precision
X * floating point argument.
X *
X * USAGE
X *
X * double log10 (x)
X * double x;
X *
X * REFERENCES
X *
X * PDP-11 Fortran IV-plus users guide, Digital Equip. Corp.,
X * 1975, pp. B-3.
X *
X * RESTRICTIONS
X *
X * For precision information refer to documentation of the
X * floating point library routines called.
X *
X * PROGRAMMER
X *
X * Fred Fish
X *
X * INTERNALS
X *
X * Computes log10(x) from:
X *
X * log10(x) = log10(e) * log(x)
X *
X */
X
X#include <stdio.h>
X#include <pmluser.h>
X#include "pml.h"
X
Xstatic char funcname[] = "log10";
X
X
Xdouble log10 (x)
Xdouble x;
X{
X extern double log ();
X
X DBUG_ENTER (funcname);
X DBUG_3 ("log10in", "arg %le", x);
X x = LOG10E * log (x);
X DBUG_3 ("log10out", "result %le", x);
X DBUG_RETURN (x);
X}
END_OF_funcs/src/log10.c
if test 1744 -ne `wc -c <funcs/src/log10.c`; then
echo shar: \"funcs/src/log10.c\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f funcs/src/matherr.c -a "${1}" != "-c" ; then
echo shar: Will not over-write existing file \"funcs/src/matherr.c\"
else
echo shar: Extracting \"funcs/src/matherr.c\" \(1609 characters\)
sed "s/^X//" >funcs/src/matherr.c <<'END_OF_funcs/src/matherr.c'
X/************************************************************************
X * *
X * N O T I C E *
X * *
X * Copyright Abandoned, 1987, Fred Fish *
X * *
X * This previously copyrighted work has been placed into the *
X * public domain by the author (Fred Fish) and may be freely used *
X * for any purpose, private or commercial. I would appreciate *
X * it, as a courtesy, if this notice is left in all copies and *
X * derivative works. Thank you, and enjoy... *
X * *
X * The author makes no warranty of any kind with respect to this *
X * product and explicitly disclaims any implied warranties of *
X * merchantability or fitness for any particular purpose. *
X * *
X ************************************************************************
X */
X
X
X/*
X * FUNCTION
X *
X * matherr default math error handler function
X *
X * KEY WORDS
X *
X * error handler
X * machine independent routines
X * math libraries
X *
X * DESCRIPTION
X *
X * Default math error handler for the math library. This routine
X * may be replaced by one of the user's own handlers. The default
X * is to do nothing and returns zero. If the user wishes to supply
X * the return value for the function, and to suppress default
X * error handling by the function, his matherr routine must return
X * non-zero.
X *
X * USAGE
X *
X * int matherr (xcpt)
X * struct exception *xcpt;
X *
X * PROGRAMMER
X *
X * Fred Fish
X *
X */
X
X#include <stdio.h>
X#include <pmluser.h>
X#include "pml.h"
X
Xstatic char funcname[] = "matherr";
X
Xint matherr (xcpt)
Xstruct exception *xcpt;
X{
X DBUG_ENTER (funcname);
X DBUG_RETURN (0);
X}
END_OF_funcs/src/matherr.c
if test 1609 -ne `wc -c <funcs/src/matherr.c`; then
echo shar: \"funcs/src/matherr.c\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f funcs/src/max.c -a "${1}" != "-c" ; then
echo shar: Will not over-write existing file \"funcs/src/max.c\"
else
echo shar: Extracting \"funcs/src/max.c\" \(1411 characters\)
sed "s/^X//" >funcs/src/max.c <<'END_OF_funcs/src/max.c'
X/************************************************************************
X * *
X * N O T I C E *
X * *
X * Copyright Abandoned, 1987, Fred Fish *
X * *
X * This previously copyrighted work has been placed into the *
X * public domain by the author (Fred Fish) and may be freely used *
X * for any purpose, private or commercial. I would appreciate *
X * it, as a courtesy, if this notice is left in all copies and *
X * derivative works. Thank you, and enjoy... *
X * *
X * The author makes no warranty of any kind with respect to this *
X * product and explicitly disclaims any implied warranties of *
X * merchantability or fitness for any particular purpose. *
X * *
X ************************************************************************
X */
X
X
X/*
X * FUNCTION
X *
X * max double precision maximum of two arguments
X *
X * KEY WORDS
X *
X * max
X * machine independent routines
X * math libraries
X *
X * DESCRIPTION
X *
X * Returns maximum value of two double precision numbers.
X *
X * USAGE
X *
X * double max (x,y)
X * double x;
X * double y;
X *
X * PROGRAMMER
X *
X * Fred Fish
X * Tempe, Az 85281
X *
X */
X
X#include <stdio.h>
X#include <pmluser.h>
X#include "pml.h"
X
X
Xdouble max (x, y)
Xdouble x;
Xdouble y;
X{
X ENTER ("max");
X DEBUG4 ("maxin", "x = %le y = %le", x, y);
X if (x < y) {
X x = y;
X }
X DEBUG3 ("maxout", "result %le", x);
X LEAVE ();
X return (x);
X}
END_OF_funcs/src/max.c
if test 1411 -ne `wc -c <funcs/src/max.c`; then
echo shar: \"funcs/src/max.c\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f funcs/src/min.c -a "${1}" != "-c" ; then
echo shar: Will not over-write existing file \"funcs/src/min.c\"
else
echo shar: Extracting \"funcs/src/min.c\" \(1412 characters\)
sed "s/^X//" >funcs/src/min.c <<'END_OF_funcs/src/min.c'
X/************************************************************************
X * *
X * N O T I C E *
X * *
X * Copyright Abandoned, 1987, Fred Fish *
X * *
X * This previously copyrighted work has been placed into the *
X * public domain by the author (Fred Fish) and may be freely used *
X * for any purpose, private or commercial. I would appreciate *
X * it, as a courtesy, if this notice is left in all copies and *
X * derivative works. Thank you, and enjoy... *
X * *
X * The author makes no warranty of any kind with respect to this *
X * product and explicitly disclaims any implied warranties of *
X * merchantability or fitness for any particular purpose. *
X * *
X ************************************************************************
X */
X
X
X/*
X * FUNCTION
X *
X * min double precision minimum of two arguments
X *
X * KEY WORDS
X *
X * min
X * machine independent routines
X * math libraries
X *
X * DESCRIPTION
X *
X * Returns minimum value of two double precision numbers.
X *
X * USAGE
X *
X * double min (x, y)
X * double x;
X * double y;
X *
X * PROGRAMMER
X *
X * Fred Fish
X * Tempe, Az 85281
X *
X */
X
X#include <stdio.h>
X#include <pmluser.h>
X#include "pml.h"
X
X
Xdouble min (x, y)
Xdouble x;
Xdouble y;
X{
X ENTER ("min");
X DEBUG4 ("minin", "x = %le y = %le", x, y);
X if (x > y) {
X x = y;
X }
X DEBUG3 ("minout", "result %le", x);
X LEAVE ();
X return (x);
X}
END_OF_funcs/src/min.c
if test 1412 -ne `wc -c <funcs/src/min.c`; then
echo shar: \"funcs/src/min.c\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f funcs/src/mod.c -a "${1}" != "-c" ; then
echo shar: Will not over-write existing file \"funcs/src/mod.c\"
else
echo shar: Extracting \"funcs/src/mod.c\" \(1520 characters\)
sed "s/^X//" >funcs/src/mod.c <<'END_OF_funcs/src/mod.c'
X/************************************************************************
X * *
X * N O T I C E *
X * *
X * Copyright Abandoned, 1987, Fred Fish *
X * *
X * This previously copyrighted work has been placed into the *
X * public domain by the author (Fred Fish) and may be freely used *
X * for any purpose, private or commercial. I would appreciate *
X * it, as a courtesy, if this notice is left in all copies and *
X * derivative works. Thank you, and enjoy... *
X * *
X * The author makes no warranty of any kind with respect to this *
X * product and explicitly disclaims any implied warranties of *
X * merchantability or fitness for any particular purpose. *
X * *
X ************************************************************************
X */
X
X
X/*
X * FUNCTION
X *
X * mod double precision modulo
X *
X * KEY WORDS
X *
X * mod
X * machine independent routines
X * math libraries
X *
X * DESCRIPTION
X *
X * Returns double precision modulo of two double
X * precision arguments.
X *
X * USAGE
X *
X * double mod (value, base)
X * double value;
X * double base;
X *
X * PROGRAMMER
X *
X * Fred Fish
X *
X */
X
X
X#include <stdio.h>
X#include <pmluser.h>
X#include "pml.h"
X
Xdouble mod (value, base)
Xdouble value;
Xdouble base;
X{
X auto double intpart;
X extern double modf ();
X
X DBUG_ENTER ("mod");
X DBUG_4 ("modin", "args %le %le", value, base);
X value /= base;
X value = modf (value, &intpart);
X value *= base;
X DBUG_3 ("modout", "result %le", value);
X DBUG_RETURN (value);
X}
END_OF_funcs/src/mod.c
if test 1520 -ne `wc -c <funcs/src/mod.c`; then
echo shar: \"funcs/src/mod.c\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f funcs/src/pmluser.h -a "${1}" != "-c" ; then
echo shar: Will not over-write existing file \"funcs/src/pmluser.h\"
else
echo shar: Extracting \"funcs/src/pmluser.h\" \(1332 characters\)
sed "s/^X//" >funcs/src/pmluser.h <<'END_OF_funcs/src/pmluser.h'
X/************************************************************************
X * *
X * N O T I C E *
X * *
X * Copyright Abandoned, 1987, Fred Fish *
X * *
X * This previously copyrighted work has been placed into the *
X * public domain by the author (Fred Fish) and may be freely used *
X * for any purpose, private or commercial. I would appreciate *
X * it, as a courtesy, if this notice is left in all copies and *
X * derivative works. Thank you, and enjoy... *
X * *
X * The author makes no warranty of any kind with respect to this *
X * product and explicitly disclaims any implied warranties of *
X * merchantability or fitness for any particular purpose. *
X * *
X ************************************************************************
X */
X
X
X/*
X * FILE
X *
X * pmluser.h include file for users of portable math library
X *
X * SYNOPSIS
X *
X * #include <pmluser.h>
X *
X * DESCRIPTION
X *
X * This file should be included in any user compilation module
X * which accesses routines from the Portable Math Library (PML).
X *
X */
X
X
X/*
X * Create the type "COMPLEX". This is an obvious extension that I
X * hope becomes a part of standard C someday.
X *
X */
X
Xtypedef struct cmplx { /* Complex structure */
X double real; /* Real part */
X double imag; /* Imaginary part */
X} COMPLEX;
END_OF_funcs/src/pmluser.h
if test 1332 -ne `wc -c <funcs/src/pmluser.h`; then
echo shar: \"funcs/src/pmluser.h\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f funcs/src/sign.c -a "${1}" != "-c" ; then
echo shar: Will not over-write existing file \"funcs/src/sign.c\"
else
echo shar: Extracting \"funcs/src/sign.c\" \(1580 characters\)
sed "s/^X//" >funcs/src/sign.c <<'END_OF_funcs/src/sign.c'
X/************************************************************************
X * *
X * N O T I C E *
X * *
X * Copyright Abandoned, 1987, Fred Fish *
X * *
X * This previously copyrighted work has been placed into the *
X * public domain by the author (Fred Fish) and may be freely used *
X * for any purpose, private or commercial. I would appreciate *
X * it, as a courtesy, if this notice is left in all copies and *
X * derivative works. Thank you, and enjoy... *
X * *
X * The author makes no warranty of any kind with respect to this *
X * product and explicitly disclaims any implied warranties of *
X * merchantability or fitness for any particular purpose. *
X * *
X ************************************************************************
X */
X
X
X/*
X * FUNCTION
X *
X * sign transfer of sign
X *
X * KEY WORDS
X *
X * sign
X * machine independent routines
X * math libraries
X *
X * DESCRIPTION
X *
X * Returns first argument with same sign as second argument.
X *
X * USAGE
X *
X * double sign (x, y)
X * double x;
X * double y;
X *
X * PROGRAMMER
X *
X * Fred Fish
X * Tempe, Az 85281
X * (602) 966-8871
X *
X */
X
X#include <stdio.h>
X#include <pmluser.h>
X#include "pml.h"
X
X
Xdouble sign (x, y)
Xdouble x;
Xdouble y;
X{
X double rtnval;
X
X ENTER ("sign");
X DEBUG4 ("signin", "args %le %le", x, y);
X if (x > 0.0) {
X if (y > 0.0) {
X rtnval = x;
X } else {
X rtnval = -x;
X }
X } else {
X if (y < 0.0) {
X rtnval = x;
X } else {
X rtnval = -x;
X }
X }
X DEBUG3 ("signout", "result %le", rtnval);
X LEAVE ();
X return (rtnval);
X}
END_OF_funcs/src/sign.c
if test 1580 -ne `wc -c <funcs/src/sign.c`; then
echo shar: \"funcs/src/sign.c\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f funcs/unused/frac.c -a "${1}" != "-c" ; then
echo shar: Will not over-write existing file \"funcs/unused/frac.c\"
else
echo shar: Extracting \"funcs/unused/frac.c\" \(1305 characters\)
sed "s/^X//" >funcs/unused/frac.c <<'END_OF_funcs/unused/frac.c'
X/************************************************************************
X * *
X * N O T I C E *
X * *
X * Copyright Abandoned, 1987, Fred Fish *
X * *
X * This previously copyrighted work has been placed into the *
X * public domain by the author (Fred Fish) and may be freely used *
X * for any purpose, private or commercial. I would appreciate *
X * it, as a courtesy, if this notice is left in all copies and *
X * derivative works. Thank you, and enjoy... *
X * *
X * The author makes no warranty of any kind with respect to this *
X * product and explicitly disclaims any implied warranties of *
X * merchantability or fitness for any particular purpose. *
X * *
X ************************************************************************
X */
X
X/*
X * FUNCTION
X *
X * frac double precision fractional portion
X *
X * KEY WORDS
X *
X * frac
X * machine dependent routines
X * math libraries
X *
X * DESCRIPTION
X *
X * Returns fractional portion of double precision number as double
X * precision number.
X *
X * USAGE
X *
X * double frac(x)
X * double x;
X *
X * PROGRAMMER
X *
X * Fred Fish
X * Tempe, Az 85281
X * (602) 966-8871
X *
X */
X
X#include <stdio.h>
X#include <pmluser.h>
X#include "pml.h"
X
X
Xdouble frac(x)
Xdouble x;
X{
X double dint();
X
X return (x - dint(x));
X}
END_OF_funcs/unused/frac.c
if test 1305 -ne `wc -c <funcs/unused/frac.c`; then
echo shar: \"funcs/unused/frac.c\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f tests/Makefile -a "${1}" != "-c" ; then
echo shar: Will not over-write existing file \"tests/Makefile\"
else
echo shar: Extracting \"tests/Makefile\" \(388 characters\)
sed "s/^X//" >tests/Makefile <<'END_OF_tests/Makefile'
XCFLAGS = -DHELP -O
XLIBS = -lpml -lm -ldbg
X
Xall : d2d dd2d c2d c2c cc2c
X
Xd2d : d2d.o
X cc -o d2d d2d.o $(LIBS)
X
Xdd2d : dd2d.o
X cc -o dd2d dd2d.o $(LIBS)
X
Xc2d : c2d.o
X cc -o c2d c2d.o $(LIBS)
X
Xc2c : c2c.o
X cc -o c2c c2c.o $(LIBS)
X
Xcc2c : cc2c.o
X cc -o cc2c cc2c.o $(LIBS)
X
X
X#
X# Clean up the directory.
X#
X
Xclean:
X rm -f c2c c2d cc2c d2d dd2d *.BAK *.bak *.tmp nohup.out *.o
END_OF_tests/Makefile
if test 388 -ne `wc -c <tests/Makefile`; then
echo shar: \"tests/Makefile\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f tests/c2d.dat -a "${1}" != "-c" ; then
echo shar: Will not over-write existing file \"tests/c2d.dat\"
else
echo shar: Extracting \"tests/c2d.dat\" \(401 characters\)
sed "s/^X//" >tests/c2d.dat <<'END_OF_tests/c2d.dat'
Xcabs 1.000000000000e00 2.000000000000e00 2.23606798052788e00
Xcabs 0.000000000000e00 2.000000000000e00 2.00000000000000e00
Xcabs 1.000000000000e00 0.000000000000e00 1.00000000000000e00
Xcabs -2.000000000000e00 2.000000000000e00 2.82842713594437e00
Xcabs -1.000000000000e00 -2.000000000000e00 2.23606798052788e00
Xcabs 1.000000000000e00 -2.000000000000e00 2.23606798052788e00
END_OF_tests/c2d.dat
if test 401 -ne `wc -c <tests/c2d.dat`; then
echo shar: \"tests/c2d.dat\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f tests/dd2d.dat -a "${1}" != "-c" ; then
echo shar: Will not over-write existing file \"tests/dd2d.dat\"
else
echo shar: Extracting \"tests/dd2d.dat\" \(1082 characters\)
sed "s/^X//" >tests/dd2d.dat <<'END_OF_tests/dd2d.dat'
Xatan2 -6.000000000000e-01 -5.000000000000e-01 -2.44685437739309e00
Xatan2 0.000000000000e00 -1.000000000000e00 -1.57079632679490e00
Xatan2 6.000000000000e-01 -5.000000000000e-01 -6.94738276196703e-01
Xatan2 1.000000000000e00 0.000000000000e00 0.00000000000000e00
Xatan2 6.000000000000e-01 5.000000000000e-01 6.94738276196703e-01
Xatan2 0.000000000000e00 1.000000000000e00 1.57079632679490e00
Xatan2 -6.000000000000e-01 5.000000000000e-01 2.44685437739309e00
Xatan2 -1.000000000000e00 0.000000000000e00 -3.14159265358979e00
Xmax 6.0 5.0 6.0
Xmax 0.0 0.0 0.0
Xmax 0.1 0.2 0.2
Xmax -0.1 -0.2 -0.1
Xmax -0.1 0.2 0.2
Xmax 0.1 0.2 0.2
Xmax 0.1 -0.2 0.1
Xmax 1e10 1.1e10 1.1e10
Xmax -1e10 -1.1e10 -1e10
Xmax 1e-10 1.1e-10 1.1e-10
Xmin 6.0 5.0 5.0
Xmin 0.0 0.0 0.0
Xmin 0.1 0.2 0.1
Xmin -0.1 -0.2 -0.2
Xmin -0.1 0.2 -0.1
Xmin 0.1 0.2 0.1
Xmin 0.1 -0.2 -0.2
Xmin 1e10 1.1e10 1e10
Xmin -1e10 -1.1e10 -1.1e10
Xmin 1e-10 1.1e-10 1e-10
END_OF_tests/dd2d.dat
if test 1082 -ne `wc -c <tests/dd2d.dat`; then
echo shar: \"tests/dd2d.dat\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f tests/unused/d2i.dat -a "${1}" != "-c" ; then
echo shar: Will not over-write existing file \"tests/unused/d2i.dat\"
else
echo shar: Extracting \"tests/unused/d2i.dat\" \(117 characters\)
sed "s/^X//" >tests/unused/d2i.dat <<'END_OF_tests/unused/d2i.dat'
Xxexp 65536.0 16
Xxexp 256.0 8
Xxexp 4.0 2
Xxexp 2.0 1
Xxexp 1.0 0
Xxexp 0.0 0
Xxexp 0.5 -1
Xxexp 0.25 -2
Xxexp 0.125 -3
END_OF_tests/unused/d2i.dat
if test 117 -ne `wc -c <tests/unused/d2i.dat`; then
echo shar: \"tests/unused/d2i.dat\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f tests/unused/di2d.dat -a "${1}" != "-c" ; then
echo shar: Will not over-write existing file \"tests/unused/di2d.dat\"
else
echo shar: Extracting \"tests/unused/di2d.dat\" \(104 characters\)
sed "s/^X//" >tests/unused/di2d.dat <<'END_OF_tests/unused/di2d.dat'
Xscale 1.0 2 4.0
Xscale 1.0 -2 0.25
Xscale 0.0 10 0.0
Xscale -1.0 2 -4.0
Xscale -1.0 -2 -0.25
END_OF_tests/unused/di2d.dat
if test 104 -ne `wc -c <tests/unused/di2d.dat`; then
echo shar: \"tests/unused/di2d.dat\" unpacked with wrong size!
fi
# end of overwriting check
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