flt_mul.c
flt_nrm.c
flt_str2fl.c
+flt_umin.c
misc.h
ucmp.c
flt_arith.3
SRC = b64_add.c flt_ar2flt.c flt_div.c flt_nrm.c b64_sft.c flt_chk.c \
flt_flt2ar.c flt_str2fl.c flt_add.c flt_cmp.c flt_mul.c ucmp.c \
- flt_modf.c
+ flt_modf.c flt_umin.c
OBJ = b64_add.$(SUF) flt_ar2flt.$(SUF) flt_div.$(SUF) flt_nrm.$(SUF) \
b64_sft.$(SUF) flt_chk.$(SUF) flt_flt2ar.$(SUF) flt_str2fl.$(SUF) \
flt_add.$(SUF) flt_cmp.$(SUF) flt_mul.$(SUF) ucmp.$(SUF) \
- flt_modf.$(SUF)
+ flt_modf.$(SUF) flt_umin.$(SUF)
.SUFFIXES: .$(SUF)
.c.$(SUF):
flt_cmp.$(SUF): misc.h flt_arith.h
flt_mul.$(SUF): misc.h flt_arith.h
flt_modf.$(SUF): misc.h flt_arith.h
+flt_umin.$(SUF): misc.h
ucmp.$(SUF): misc.h flt_arith.h
.B flt_div(e1, e2, e3)
.B flt_arith *e1, *e2, *e3;
.PP
+.B flt_umin(e)
+.B flt_arith *e;
+.PP
.B flt_modf(e1, intpart, fractpart)
.B flt_arith *e1, *intpart, *fractpart;
.PP
.B int flt_cmp(e1, e2)
.B flt_arith *e1, *e2;
.PP
-.B int flt_str2flt(s, e)
+.B flt_str2flt(s, e)
.B char *s;
.B flt_arith *e;
.PP
and stores the result indirectly through
.IR e3 .
.PP
+.B flt_umin
+negates the number indicated by
+.I e
+and stores the result indirectly through
+.IR e .
+.PP
.B flt_modf
splits the number indicated by
.I e
.B flt_arith2flt
converts the number
.I n
-to the floating point format use in this package and returns the result
+to the floating point format used in this package and returns the result
in
.IR e .
.PP
register char *s1;
char Xbuf[NDIG+12];
register char *s = Xbuf;
+ flt_arith e1;
+ e1 = *e;
flt_status = 0;
- s1 = flt_ecvt(e,NDIG,&dp,&sign);
+ s1 = flt_ecvt(&e1,NDIG,&dp,&sign);
if (sign)
*s++ = '-';
*s++ = *s1++;
s = Xbuf;
s1 = buf;
do {
- *s1++ = *s++;
- } while (*s);
+ *s1++ = *s;
+ } while (*s++);
}
--- /dev/null
+/*
+ (c) copyright 1988 by the Vrije Universiteit, Amsterdam, The Netherlands.
+ See the copyright notice in the ACK home directory, in the file "Copyright".
+*/
+
+/* $Header$ */
+
+#include "misc.h"
+
+flt_umin(e)
+ flt_arith *e;
+{
+ /* Unary minus
+ */
+ flt_status = 0;
+ e->flt_sign = ! e->flt_sign;
+}