/* x is unsigned; slightly hackish in handling numbers with the high * bit set. (I _think_ it always gives the right answer, since * 63335-32768 all have five digits, the same as 32767...) */ ndigits(ax) { register x, i; if ((x = ax) == 0) return(1); if (x < 0) x = 077777; i = 0; while (x > 0) { i++; x =/ 10; } return(i); } odigits(ax) { register x, i; if ((x = ax) == 0) return(1); if (x < 0) { i = 1; x = 077777; } else i = 0; while (x > 0) { i++; x =/ 8; } return(i); }