I'm having trouble understanding the syntax of Java and how to use Java to solve math equations. Below is just an example of a simple equation. I want the program to simply be able to output the result of the calculation. If anyone can help I would greatly appreciate it!
2.6^22 + 3.9^15
Try with
you could use the Math class, here,. in your case you can do:
that's it,.
How about this:
Use the Math library.
This will return a
double
The first argument of
pow
function is the base and the second argument is the power.See also the
ScriptEngine
.