Search code examples
c#value-type

What's the type for "half" (binary16) in C#?


I'm working in a context where nVidia GPU's are implied, which leads me to using the "half" (binary16, low precision floating-point number) type. However, I don't know to which type this translates in C#. Any idea?

http://en.wikipedia.org/wiki/Half_precision_floating-point_format


Solution

  • Prior to .NET 5.0, .NET doesn't support "half" as a basic type. However, there are libraries providing conversion routines.