What's up with Half.MaxValue in .NET?
In this episode of .NET Deep Dives, Ian Griffiths explores the peculiar behaviour of the half-precision floating point type.
By using the simplicity of a C# program that prints an incorrect maximum value for this type, the video explains floating point representation intricacies, especially with 16-bit values. It delves into the concept of precision and range, illustrating the vast differences between single, double, and half-precision floats. The discussion clarifies .NET's formatting behaviour, which rounds half-precision values to avoid spurious precision in display, leading to seemingly wrong output.
Endjin are proud to be a .NET Foundation Corporate Sponsor, as we are maintainers of Reactive Extensions for .NET (AKA ReactiveX AKA Rx.NET) which is one of the most well established and widely used open source .NET projects.
Published on:
Learn moreRelated posts
C# Source Generators Boost Productivity in the Rx.NET Repo
Code generation has become increasingly important in recent versions of .NET, especially when using AOT compilation. But they can also play a ...
How .NET 9.0 boosted JSON Schema performance by 32%
We benchmarked endjin's JSON Schema library on .NET 9.0 and saw large performance gains. There are even more gains to be had with new System.T...
How .NET 9.0 boosted AIS.NET performance by 9%
.NET 9.0 has shipped, and for the fourth year running, we benchmarked endjin's AIS.NET library and were very happy to see substantial performa...
Json Schema Patterns in .NET - Open vs. Closed Types
This post provides insights into some common patterns in C# and JSON Schema design. Specifically, it examines the crucial concept of object ex...
Glenn Condron: .NET Web Development - Episode 293
This episode features an interview with Glenn Condron, Principal Product Manager for the App Platform team within the Developer Division at Mi...
Modernizing Reactive Extensions for .NET
Endjin are proud to be a .NET Foundation Corporate Sponsor, as we are maintainers of Reactive Extensions for .NET (AKA ReactiveX AKA Rx.NET) w...
High Performance JSON Serialization With Code Generation on C# 11 and .NET 7.0
Looking for ways to improve the parsing and generation of JSON data in your .NET applications? This talk showcases how recent features added t...
Mitchel Sellers: Architecting .NET MAUI - Episode 254
In this episode of the podcast, Mitchel Sellers, a 15-time Microsoft MVP, talks about .NET MAUI and its architecture standards, performance, s...
An overview of Reaqtor AKA Cloud Native Rx
Endjin, a .NET Foundation Corporate Sponsor, maintains Reactive Extensions for .NET and Reaqtor - two key components of the .NET Foundation, a...
David Pine: NET Content Development - Episode 223
In this episode of the Architect Tips podcast, David Pine, Developer Relations specialist at Microsoft and expert in Web Technologies, discuss...