For future reference, it will help a lot if you copy-and-paste the exact error message here. I would guess that the particular operator you are referring to is the ^. In Java, this is not an exponent operator as it is in other languages. As EFH says, you need to use Math.pow() instead. Notice that you need to specify the class name when you use a static method from another class (such as the Math class).