Consider `double x = 5.0; double y = 3.0; x = (x * 1.5) - y; printf("x is %g\n", x);`. C evaluates intermediate values—5.0, 7.5, 3.0, 4.5—then stores 4.5 in `x` and prints it. A value is abstract data that can be evaluated in a C condition: zero means false, while a nonzero value means true. section 5.1 section 5.1.1
double x = 5.0;
double y = 3.0;
...
x = (x * 1.5) - y;
printf("x is \%g\n", x);
!@%STYLE%@!
{"css":"{\"css\": \"font-weight: bold;\"}","target":"[[{\"line\":0,\"ch\":3},{\"line\":0,\"ch\":9}],[{\"line\":1,\"ch\":3},{\"line\":1,\"ch\":9}],[{\"line\":0,\"ch\":3},{\"line\":0,\"ch\":9}],[{\"line\":1,\"ch\":3},{\"line\":1,\"ch\":9}],[{\"line\":4,\"ch\":3},{\"line\":4,\"ch\":9}]]"}
!@%STYLE%@!
Trace the variables and intermediate results in the example from initialization through assignment and output. section 5.1
TAKEAWAY
- Reason primarily about values rather than their machine representations; representations may vary across architectures and types. section 5.0
- Treat every value as having a statically determined type, which determines permitted operations and their results. section 5.1.2
- Distinguish values from data: execution data assembles the values held by all objects at a particular moment. section 5.1.1
- Remember that unobserved intermediate results need not exist in the final executable when optimization preserves the observable result. section 5.1
Values are modeled as mathematical entities independent of a particular run, executable, or representation. C’s basic values are numbers or translate to numbers, although some types—such as characters, truth values, or floating-point values—serve roles beyond ordinary arithmetic. section 5.1.1 section 5.8






