[m-rev.] for review: mercury implementation of string__format

Fergus Henderson fjh at cs.mu.OZ.AU
Fri Nov 22 22:58:48 AEDT 2002


On 22-Nov-2002, Peter Moulder <pmoulder at csse.monash.edu.au> wrote:
> If writing in C, the obvious code would be something like
> 
>   (val < 10
>    ? '0' + val
>    : 'a' - 10 + val)

This assumes that the numeric codes for 'a'-'f' are contiguous,
which is not guaranteed by the C standard, I'm pretty sure.
I think it might fail for EBCDIC systems?

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list