if(1,
$set name "hello"
else
$set name "world"
);
display "%name%";
which may be surprising to non-expert GAMS users.
Here is one that may even stump hardcore GAMS modelers:
scalar s /NA/;
s$(s>1) = 3.14;
display s;
Question: can you predict the result of the display statement?
Is this a feature or a bug?
ReplyDeleteIs there a purpose in returning True to (NA>1)?
Not sure if this is a design bug or feature, but in GAMS any operation on NA returns NA. Hence (NA>1) is evaluated as NA, and $NA is interpreted as true (or rather as "does exist").
ReplyDelete