From 2123817e42c631cb26ff7285f13af5749df4c22f Mon Sep 17 00:00:00 2001 From: David Sosa Date: Sun, 8 Jan 2023 13:27:46 +0100 Subject: [PATCH] [Exercise 4.35] Corrected implicit conversion comment. --- ch4/4.35.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ch4/4.35.cpp b/ch4/4.35.cpp index 98b03c5..d290b9a 100644 --- a/ch4/4.35.cpp +++ b/ch4/4.35.cpp @@ -9,10 +9,11 @@ int main() { // 'a' is promoted to `int`, then added to `3`, then converted to `char`. fval = ui - ival * 1.0; - // `ival` is converted to double, then multiplied by `1.0`. The result is - // converted to `unsigned int`, then subtracted by `ui`. The result is + // `ival` is converted to double, then multiplied by `1.0`. `ui` is converted + // to `double`, then the subtraction is carried out. The result is // converted to `float`, then assigned to `fval`. + dval = ui * fval; // Since `float` usually has more bits then `unsigned int`, `ui` is converted // to `float`, then multiplied by `fval`. The result is converted to