/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
/*
* Copyright (c) 1980 Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
*/
/* Portions Copyright(c) 1988, Sun Microsystems Inc. */
/* All Rights Reserved */
/*
* Copyright (c) 1997, by Sun Microsystems, Inc.
* All rights reserved.
*/
#ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.1 */
/* LINTLIBRARY */
#include <stdio.h>
#include <mp.h>
#include "libmp.h"
#include <stdlib.h>
static int
{
int sign, c;
_mp_xfree(a);
sign = 1;
qten = b;
x.len = 0;
y.len = 1;
switch (c) {
case '\\':
(void) getc(f);
continue;
case '\t':
case '\n':
_mp_xfree(&x);
return (0);
case ' ':
continue;
case '-':
continue;
default:
if (c >= '0' && c <= '9') {
qy = c - '0';
mp_madd(a, &y, a);
_mp_move(a, &x);
continue;
} else {
return (0);
}
}
return (EOF);
}
static void
{
short r;
MINT x;
char *obuf;
char *bp;
if (a == NULL)
return;
sign = 1;
if (xlen < 0) {
sign = -1;
}
if (xlen == 0) {
(void) fprintf(f, "0\n");
return;
}
for (i = 0; i < xlen; i++)
*bp-- = 0;
while (x.len > 0) {
for (i = 0; i < 10 && x.len > 0; i++) {
mp_sdiv(&x, b, &x, &r);
*bp-- = (char)(r + '0');
}
if (x.len > 0)
*bp-- = ' ';
}
if (sign == -1)
*bp-- = '-';
_mp_xfree(&x);
}
void
{
MINT x, y;
short sign;
sign = 1;
if (n < 0) {
n = -n;
}
if (x.len < 0) {
}
s_div(&x, n, &y, r);
_mp_xfree(q);
*r = *r * sign;
}
static void
{
int qlen;
int i;
int x;
short *qval;
short *aval;
x = 0;
for (i = qlen - 1; i >= 0; i--) {
x = x * 0100000 + *--aval;
*--qval = (short)(x / n);
x = x % n;
}
*r = (short)x;
qlen--;
if (qlen == 0)
}
int
{
}
int
{
}
void
{
}
void
{
}
void
{
m_out(a, 10, f);
}
int
{
return (m_in(a, 10, f));
}