Next: Programming Language Features
Up: Systems Aspects, from D.
Previous: Instruction Sets
A language should define the semantics precisely enough
to prove statements about the programs. Common points of ambiguity:
- x=3.0/10.0 FP number, it is usually not specified that all occurrences
of 10.0*x must have the same value.
- what happens during exceptions.
- interpretation of parenthesis.
- evaluation of subexpressions. If x real and m,n integers,
in the expression x+m/n is the division integer or FP?
For example, we can compute all the operations in the highest precision present
in the expression; or we can assign from bottom up in the expression graph
tentative precisions based on the operands, and then from top down
assign the maximum of the tentative and the expected precision.
- defining the exponential consistently. Ex: (-3)**3 = -27 but
(-3.0)**(3.0) is problematic, as it is defined via logarithm.
Goldberg proposes to consider
for all then
. For example,