Name: Anonymous 2007-09-13 19:00 ID:apP5YkPr
I just started looking into Java programing and I have read some online things about it.
I decided to fiddle around with some programs just multiplying basic numbers. I have set up a float variable for 0.182, when I try to compile I get a "Possible loss or precision" error. What does this mean?
Also my code
class Mutiply {
public static void main(String[] arguments) {
float number1 = 5;
float number2 = 0.182;
float result = number1 * number2;
System.out.println(number1 + " Times " + number2);
System.out.println("\nResult");
}
}
I decided to fiddle around with some programs just multiplying basic numbers. I have set up a float variable for 0.182, when I try to compile I get a "Possible loss or precision" error. What does this mean?
Also my code
class Mutiply {
public static void main(String[] arguments) {
float number1 = 5;
float number2 = 0.182;
float result = number1 * number2;
System.out.println(number1 + " Times " + number2);
System.out.println("\nResult");
}
}