Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chapter 13 Exercise 3 #2

Open
brainuser5705 opened this issue May 22, 2021 · 0 comments
Open

Chapter 13 Exercise 3 #2

brainuser5705 opened this issue May 22, 2021 · 0 comments

Comments

@brainuser5705
Copy link

brainuser5705 commented May 22, 2021

First off thanks for having this repo, it's definitely great to look at someone else's implementations of the exercises.

I believe for the last expression in Chapter 13 Exercise 3, the final type is a double, not a float.
I think the conversions take place in this order:

  1. l is casted to a double since the cast operator takes precedence over the operations.
  2. i/l results in i converting to an double and that makes the result '0.2' as a double.
  3. l +0.2 results in l converting to a double and that makes the result '500.2' as a double.

I checked with the order Kochan listed, but I could be wrong?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant