1 // fprinthexadecimal().
14 void fprinthexadecimal (cl_ostream stream, unsigned long x)
17 var char buf[bufsize+1];
18 var char* bufptr = &buf[bufsize];
21 unsigned long q = x / 16;
22 unsigned long r = x % 16;
23 *--bufptr = (r<10 ? '0'+r : 'A'-10+r);
26 fprint(stream,bufptr);
30 void fprinthexadecimal (cl_ostream stream, long x)
33 fprintdecimal(stream,(unsigned long)x);
35 fprintchar(stream,'-');
36 fprintdecimal(stream,(unsigned long)(-1-x)+1);