开发者

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

开发者 https://www.devze.com 2023-02-03 18:26 出处:网络
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 t

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


.NET 5 includes System.Half to represent the IEEE 754-2008 binary16 floating point data type. There's no C# type for it (yet), though.


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

0

精彩评论

暂无评论...
验证码 换一张
取 消