Applying the modulus operator, %, to floating-point values : Float Point Data Type « Data Type « Java Tutorial






public class MainClass{

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

}
0.1999999999999998








2.10.Float Point Data Type
2.10.1.Floating-Point Data Types: memory and length
2.10.2.Write Floating-Point Literals with an exponent
2.10.3.Floating-Point Calculations
2.10.4.Using ++ and -- with floating-point variables
2.10.5.Applying the modulus operator, %, to floating-point values