How to get size of a float data type in C#

1 Answer

0 votes
using System;

namespace ConsoleApplication_C_Sharp
{
    class Program
    {
        static void Main(string[] args)
        {
            int total = sizeof(float);

            Console.WriteLine("{0} bytes ({1} bit) per float", total, total * 8);
        }
    }
}


/*
run:
  
4 bytes (32 bit) per float

*/

 



answered Jan 12, 2017 by avibootz

Related questions

1 answer 149 views
1 answer 185 views
1 answer 164 views
1 answer 168 views
1 answer 161 views
161 views asked Jan 12, 2017 by avibootz
1 answer 147 views
1 answer 159 views
...