[std-interval] More on interval computations as proofs
Gabriel Dos Reis
gdr at integrable-solutions.net
Fri Oct 6 15:50:04 PDT 2006
"R. Baker Kearfott" <rbk at louisiana.edu> writes:
| Certainly, it is desirable that sqr(x) return [0,1] for x=[-1,1].
| However, isn't the question of x*x returning [0,1] instead of [-1,1]
| a question of optimization, and of proper interpretation of what
| the programmer intended?
Certainly there is a syntactic difference. The question as to whether
there is a semantics difference is not clear to me. I'm not sure, it
should be left to the compiler/library writer to second guess what the
programmer intended.
In the current C++ standard, an implementation is free to yield 5 for
2 + 2 and still be conforming -- the argument could be made that if
the programmer intended 4 he/she would have written so (yes, it is a
facetious argument, but you get the point). I would be hard pressed
to say that it is just a question of optimization.
| Also, have we distinguished what should
| be mandated in the standard and what is just desirable in an
| implementation?
>From the "standardese" point of view, you can only put requirements.
-- Gaby
More information about the Std-interval
mailing list