qeconvert.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* Copyright (c) 1988 by Sun Microsystems, Inc.
*/
#include "base_conversion.h"
char *
char *buf;
{
int i;
static char *nanstring = "NaN";
static char *infstring = "Infinity";
char *pc;
int nc;
case fp_normal:
case fp_subnormal:
for (i = 0; i < ndigits; i++)
break;
case fp_zero:
*decpt = 1;
for (i = 0; i < ndigits; i++)
buf[i] = '0';
break;
case fp_infinity:
*decpt = 0;
if (ndigits < 8)
nc = 3;
else
nc = 8;
goto movestring;
case fp_quiet:
case fp_signaling:
*decpt = 0;
nc = 3;
for (i = 0; i < nc; i++)
break;
}
return buf; /* For compatibility with ecvt. */
}
char *
char *buf;
{
int i;
case fp_normal:
case fp_subnormal:
if (ndigits >= 0)
else
break;
case fp_zero:
*decpt = 0;
buf[0] = '0';
for (i = 1; i < ndigits; i++)
buf[i] = '0';
buf[i] = 0;
break;
case fp_infinity:
*decpt = 0;
if (ndigits < 8)
buf = "Inf";
else
buf = "Infinity";
break;
case fp_quiet:
case fp_signaling:
*decpt = 0;
buf = "NaN";
break;
}
return buf; /* For compatibility with fcvt. */
}
extern void _gcvt();
char *
char *buf;
{
return (buf);
}