Skip to content

Chapter 13 Exercise 3 #2

Open
Open
@brainuser5705

Description

@brainuser5705

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions