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 258 views
1 answer 304 views
1 answer 259 views
1 answer 267 views
1 answer 262 views
262 views asked Jan 12, 2017 by avibootz
1 answer 245 views
1 answer 263 views
...