I'm having a problem with the following calculation in a line of code:
10^(dB/20)
...where dB is a float. I get Error: Expression must have integral or enum type.
How can I get around this?
Thanks in advance.
^ is the bitwise xor operator in C++. Use std::pow in <cmath> instead.
You aren't allowed to overload operators to where both operands are primitive types.
You should put
into a temp variable.
int temp = dB/20;
... = 10 ^ temp; |
Last edited on
You aren't allowed to overload operators to where both operands are primitive types.
for majidkamali 1370
Actually, it is useless when both operands are primitive types