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 166 views
1 answer 202 views
1 answer 182 views
1 answer 187 views
1 answer 177 views
177 views asked Jan 12, 2017 by avibootz
1 answer 157 views
1 answer 171 views
...