Mega Code Archive

 
Categories / Java Tutorial / Data Type
 

Applying the modulus operator, %, to floating-point values

public class MainClass{   public static void main(String[] arg){      double a = 2.4;      double b = 0.2;                       System.out.println( a % b );   } } 0.1999999999999998