logoalt Hacker News

1a527dd5 • yesterday at 5:10 PM • 2 replies • view on HN

https://learn.microsoft.com/en-us/dotnet/core/compatibility/...

Be aware

    (decimal)0.1
    // .NET 10: 0.1
    // .NET 11: 0.1000000000000000055511151231

Replies

rednb • yesterday at 7:22 PM

Wow, what a vicious footgun. I do a lot of work related to pricing, invoicing, exchange rates etc... where decimals do matter, so this kind of stresses me out. Thanks for the heads up.

➕ show 3 replies
xnorswap • yesterday at 5:23 PM

Thanks for that heads up, also:

    (decimal)0.1f
    0.100000001490116119384765625