Use Remainder Operator on float point data type : Float : Data Type C# Examples


C# Examples » Data Type » Float »

 

Use Remainder Operator on float point data type









    
using  System;

class  MainClass
{
      static  void  Main()
      {
            Console.WriteLine("0.0f  %  1.3f  is  {0}",  0.0f  %  1.3f);
            Console.WriteLine("0.3f  %  1.3f  is  {0}",  0.3f  %  1.3f);
            Console.WriteLine("1.0f  %  1.3f  is  {0}",  1.0f  %  1.3f);
            Console.WriteLine("1.3f  %  1.3f  is  {0}",  1.3f  %  1.3f);
            Console.WriteLine("2.0f  %  1.3f  is  {0}",  2.0f  %  1.3f);
            Console.WriteLine("2.3f  %  1.3f  is  {0}",  2.3f  %  1.3f);
      }
}
    
   
  
   



Output

0.0f % 1.3f is 0
0.3f % 1.3f is 0.3
1.0f % 1.3f is 1
1.3f % 1.3f is 0
2.0f % 1.3f is 0.7
2.3f % 1.3f is 1


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Data Type
» Float