The operator ^ is undefined for arguments
java, math, operators
Solution
The `^` operator isn't the exponentiation operator in Java; it's the bitwise XOR operator, which doesn't make much sense with `double` arguments.
You can either multiply the value by itself or you can call `Math.pow(yourValue, 2)` for exponentiation.
Problem
``` (((difference - previousStep)/1000)^2) //difference and previousStep are both doubles ``` Why can't I use the ^ operator with doubles? I just want to know why. Luckily for me I can just multiple difference - previousStep by itself because i'm just squaring it, but if i need to bring it to the Nth power, then this would be a problem. So why can't you ^ doubles and is there a way around this?