Skip to content

Strange behavior of map<XXX, unknown> #384

Answered by lesquoyb
hdelattr asked this question in Q&A
Discussion options

You must be logged in to vote

Hello and thank you for your detailed example model.

The first issue you encounter: having 11 instead of 2 is not really a bug but simply a problem of priority of operations. What is read by the interpreter is something like this:

write "some string" + <float> + <float>;

and the priority is this one:

write ( ("some string" + <float>) + float)

so in that context all + are to be interpreted as concatenation and not addition. You don't see that with the multiplication example because the multiplication has a higher priority than the addition, and so

write "some string" + <float> * <float>;

resolves like this:

write ("some string" + (<float> * <float>));

and so the concatenation is done a…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by hdelattr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants