|
|
DataMuseum.dkPresents historical artifacts from the history of: Commodore CBM-900 |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Commodore CBM-900 Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - download
Length: 399 (0x18f)
Types: TextFile
Notes: UNIX file
Names: »atol.c«
└─⟦f27320a65⟧ Bits:30001972 Commodore 900 hard disk image with partial source code
└─⟦f4b8d8c84⟧ UNIX Filesystem
└─⟦this⟧ »libc/gen/atol.c«
/*
* Non-floating ASCII to long conversion
*
* long atol(cp)
* char *cp;
*/
long
atol(cp)
register char *cp;
{
register long val;
register c;
register sign;
val = sign = 0;
while ((c = *cp)==' ' || c=='\t')
cp++;
if (c == '-') {
sign = 1;
cp++;
} else if (c == '+')
cp++;
while ((c = *cp++)>='0' && c<='9')
val = val*10 - c + '0';
if (!sign)
val = -val;
return (val);
}