On Tue, 18 Dec 2007, Ignacio Diaz-Emparanza wrote:
It is not exactly a bug but a bad behavior I think.
I discovered that the command
if v1=7 && 0<v0<7
...
endif
is processing only the first condition and not the second,
without givien any error or warning. If the second condition is
considered ill-formatted I think gretl should not process the
block.
Aha! The second condition is not ill-formatted, and it is being
processed. It's just not doing what you think it does -- but it
has that in common with all implementations of the inequality
operators in programming languages that I know.
The second condition is parsed as
(0<v0) < 7
Suppose v0 = 10. Then (0<v0) = 1, which is < 7, so the
condition is satisfied.
To do what you want, you need:
if v1=7 && 0<v0 && v0<7
Allin.