File:  [MW Coherent from dump] / coherent / b / lib / libc / gen / ctol.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Wed May 29 04:56:35 2019 UTC (7 years ago) by root
Branches: MarkWilliams, MAIN
CVS tags: relic, HEAD
coherent

/*
 * Convert a comp_t style number to a long.
 * A comp_t contains 3 bits of base-8 exponent
 * and a 13-bit mantissa.  Only unsigned
 * numbers can be comp_t numbers.
 */

#include <sys/types.h>
#include <acct.h>
#define	MAXMANT		017777		/* 2^13-1 - largest mantissa */

long
ctol(c)
comp_t c;
{
	register exp;
	long mant;

	mant = c&MAXMANT;
	exp = (c>>13)&07;
	while (exp--)
		mant <<= 3;
	return (mant);
}

unix.superglobalmegacorp.com

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