Read up on how conversion works in Java. You get 0.0 because 8 and 2000 are both seen by the compiler as integers. The result of integer division is always an integer. Java also truncates the result. Thus the result of (8/2000) is the integer value 0 which is then automatically converted to a float (0.0f) and assigned to the variable f1. One solution for you would be to make at least one of your operands a float, e.g.
Note that floating point calculations may lose precision so you may or may not get the exact results that you are looking for. HTH J. Lacar
[This message has been edited by JUNILU LACAR (edited March 02, 2001).]