Annotation of 43BSDTahoe/usr.lib/libpc/EXPO.c, revision 1.1.1.1

1.1       root        1: /* Copyright (c) 1979 Regents of the University of California */
                      2: 
                      3: static char sccsid[] = "@(#)EXPO.c 1.2 3/7/81";
                      4: 
                      5: long
                      6: EXPO(value)
                      7: 
                      8:        double  value;
                      9: {
                     10:        register int retval;
                     11:        register char *cp;
                     12:        char sign, buf[30];
                     13:        extern char *index();
                     14: 
                     15:        if (value == 0.0)
                     16:                return 0;
                     17:        sprintf(buf, "%.1e", value);
                     18:        cp = index(buf, 'e') + 1;
                     19:        sign = *cp++;
                     20:        retval = 0;
                     21:        while (*cp)
                     22:                retval = retval * 10 + *cp++ - '0';
                     23:        return sign == '-' ? -retval : retval;
                     24: }

unix.superglobalmegacorp.com

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