File:  [Research Unix] / researchv9 / libc / math / pow10.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 17:22:00 2018 UTC (8 years, 1 month ago) by root
Branches: belllabs, MAIN
CVS tags: researchv9-SUN3_old, researchv9-SUN3, HEAD
researchv9-SUN3(old)

static	double	p[10] =
{
	1.0e0,
	1.0e1,
	1.0e2,
	1.0e3,
	1.0e4,
	1.0e5,
	1.0e6,
	1.0e7,
	1.0e8,
	1.0e9,
};

double
pow10(e)
{
	int i;

	if(e < 0)
		return 1 / pow10(-e);
	if(e >= 10) {
		i = e/2;
		return pow10(i) * pow10(e-i);
	}
	return p[e];
}

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.