1 // fprinthexadecimal().
12 #if defined(CL_IO_STDIO)
14 void fprinthexadecimal (cl_ostream stream, unsigned long x)
16 fprintf(stream,"%lX",x);
21 #if defined(CL_IO_IOSTREAM)
23 void fprinthexadecimal (cl_ostream stream, unsigned long x)
26 var char buf[bufsize+1];
27 var char* bufptr = &buf[bufsize];
30 unsigned long q = x / 16;
31 unsigned long r = x % 16;
32 *--bufptr = (r<10 ? '0'+r : 'A'-10+r);
35 fprint(stream,bufptr);
41 void fprinthexadecimal (cl_ostream stream, long x)
44 fprintdecimal(stream,(unsigned long)x);
46 fprintchar(stream,'-');
47 fprintdecimal(stream,(unsigned long)(-1-x)+1);