diff --git a/modules/arithmetic-promotion-and-conversions.md b/modules/arithmetic-promotion-and-conversions.md index 17bb704c..98314742 100644 --- a/modules/arithmetic-promotion-and-conversions.md +++ b/modules/arithmetic-promotion-and-conversions.md @@ -27,9 +27,9 @@ example: ```C int i; -unsigned long long ll; +unsigned long long ull; -i + ll; // type of the result is unsigned long long and 'i' +i + ull; // type of the result is unsigned long long and 'i' // is converted to unsigned long long BEFORE '+' is // applied. See below what happens if 'i' contains a // negative number. @@ -61,7 +61,7 @@ sizeof (c + 1) // is 4 ``` Note that we already know that `c` is **never** modified as the expression in -`sizeof` is never evaluated. See the +`sizeof` is never evaluated. See the #module sizeof.md sizeof module for to review the knowledge. @@ -407,18 +407,18 @@ variables: * incorporate into the C code, compile, and verify you got it right. */ -unsigned long long ll = -13; // Use %llu in printf() to verify. -signed char c = 999; // %d -short int si = -1; // %hd -unsigned int = -1; // %u -unsigned short int usi = 999999; // %hu -signed char c = 0 ? -10 : 0U; // %d -signed char c = -1 ? -10 : 0U; // %d -long long ll = 1U + -10; // %lld -unsigned long long ull = 1U + -10; // %llu -unsigned short int si = INT_MIN + 13LU; // %hu -unsigned short int si = -INT_MAX + 13U; // %hu -signed char c = 129; // %d +unsigned long long ull = -13; // Use %llu in printf() to verify. +signed char sc = 999; // %d +short int si = -1; // %hd +unsigned int ui = -1; // %u +unsigned short int usi = 999999; // %hu +signed char sc = 0 ? -10 : 0U; // %d +signed char sc = -1 ? -10 : 0U; // %d +long long ll = 1U + -10; // %lld +unsigned long long ull = 1U + -10; // %llu +unsigned short int usi = INT_MIN + 13LU; // %hu +unsigned short int usi = -INT_MAX + 13U; // %hu +signed char sc = 129; // %d /* What is printed? */ printf("%hhu\n", -3);