12 #if defined(CL_IO_STDIO)
14 void fprintdecimal (cl_ostream stream, unsigned long x)
16 fprintf(stream,"%lu",x);
19 void fprintdecimal (cl_ostream stream, long x)
21 fprintf(stream,"%ld",x);
26 #if defined(CL_IO_IOSTREAM)
28 // We don't use `stream << x' or `stream << dec << x', because an ostream
29 // carries so many attributes, and we don't want to modifies these attributes.
31 void fprintdecimal (cl_ostream stream, unsigned long x)
34 var char buf[bufsize+1];
35 var char* bufptr = &buf[bufsize];
38 unsigned long q = x / 10;
39 unsigned long r = x % 10;
43 fprint(stream,bufptr);
47 void fprintdecimal (cl_ostream stream, long x)
50 fprintdecimal(stream,(unsigned long)x);
52 fprintchar(stream,'-');
53 fprintdecimal(stream,(unsigned long)(-1-x)+1);