![]() ![]() On two's complement hardware, it won't convert the most-negative number correctly, because it attempts to convert a negative number to its equivalent positive number with N = -N In two's complement, the maximally negative number doesn't have a corresponding positive number, unless you promote it to a larger type. This does have a bug (but one I'd consider fairly minor). ![]() You can do it recursively as follows (beware INT_MIN if you're using two's complement, you'll need extra code to manage that): void printfcomma2 (int n)
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |