Annotation of coherent/b/lib/libc/gen/ltoc.c, revision 1.1

1.1     ! root        1: /*
        !             2:  * Convert long to comp_t style number.
        !             3:  * A comp_t contains 3 bits of base-8 exponent
        !             4:  * and a 13-bit mantissa.  Only unsigned
        !             5:  * numbers can be comp_t numbers.
        !             6:  */
        !             7: 
        !             8: #include <acct.h>
        !             9: #include <sys/types.h>
        !            10: 
        !            11: #define        MAXMANT         017777          /* 2^13-1 = largest mantissa */
        !            12: 
        !            13: comp_t
        !            14: ltoc(l)
        !            15: long l;
        !            16: {
        !            17:        register exp;
        !            18: 
        !            19:        if (l < 0)
        !            20:                return (0);
        !            21:        for (exp = 0; l > MAXMANT; exp++)
        !            22:                l >>= 3;
        !            23:        return ((exp<<13) | l);
        !            24: }

unix.superglobalmegacorp.com

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