Download MetaTrader 5

How do I apply a bitwise operator to a non integer value?

To add comments, please log in or register
Tom Maryland
77
Tom Maryland  

Hi,I want to subtract a decimal point number lets say as an example 0.256 from an integer lets say 831 and then square the result,like so:

x= (a-b)^2;

but the compiler gives me the error, "'^' - bitwise operators are to be applied to integer values only"
Simon Gniadkowski
Moderator
18046
Simon Gniadkowski  
Redael777:

Hi,I want to subtract a decimal point number lets say as an example 0.256 from an integer lets say 831 and then square the result,like so:

You cannot . . . ^2 is not squaring it is a bitwise EXCLUSIVE OR with 2

To square use this MathPow(a - b, 2)
Tom Maryland
77
Tom Maryland  
ohh,thanks. )
To add comments, please log in or register