3 ms·
(.NET) Introducing the Half Type
- rspeele 6y agoNot to deny that this has a legitimate use in graphics and stuff I don't know about... But I suspect I will see this misused more often than used correctly, when penny-wise and pound-foolish programmers feel, absent any performance or memory issue, that they don't "need" a float or double. Kind of like how when people are new to programming they often reach for uints when they "don't need negative numbers" and then get surprised-pikachu-face when their sanity checks for (x - y >= 0) are always true.
- amir734jj 6y agoWhat would the underlining CLR type be? I think they could have spent the time developing more interesting features (maybe borrow some functional concepts from F# and Haskell) rather than this
- pjmlp 6y agoThis is the kind of stuff that helps to stay in .NET instead of having to get hold of C++. I am glad they introduced it, just would like to have had a C# type alias to go alongside it.
- fanf2 6y agoThere are some interesting compatibility issues around 16 bit floating point types. As well as the IEEE layout (5 exponent, 10 mantissa) there’s bfloat16 which has the same range as 32 bit float (8 exponent) but less precision (7 mantissa) https://en.wikipedia.org/wiki/Bfloat16_floating-point_format https://en.wikipedia.org/wiki/Bfloat16_floating-point_format