I\'m new to Java. I wrote the following code:
import java.io.*;
import java.lang.*;
public class distravel
{
public static void main(String args[])
It is because Math.pow() returns a double which you then do some calculations with.
No matter what calculations you do the precision you will have to deal with is double.
Therefore, you get the error message.
Solutions:
1) make the floats double
2) cast the result to float: d=(float)((u*t)+a*Math.pow(t,x))/2F;