Skip to content

Missing logic and math operators #154

Answered by beltoforion
bar0n3ashura asked this question in Q&A
Discussion options

You must be logged in to vote

Some operators may not be available because everyone has a different preference or need. Binary operators are not supported because the underlying default type is a floating point value. Bitwise operators do not work on floating point values.

muparser does not have a type system and cannot check wether a given equation makes sense. To be absolutely save one would need to introduce an int function and make sure binary operators can only be applied to the output of the int function. That looks odd in an equation. Alternatively one could implement the binary operator in a way that it simply converts the parameters to int. If you do this do not use (int) casting because your input may be some…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@bar0n3ashura
Comment options

@bar0n3ashura
Comment options

Answer selected by bar0n3ashura
Comment options

You must be logged in to vote
0 replies
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