The Wire · Showcase
RUNTIME FIXES DECIMAL AND BIGINTEGER ROUNDING BUGS THAT LOST PRECISION
By RepoJournal · Filed · About .NET
Three critical numeric conversion bugs that silently corrupted precision in decimal, BigInteger, and floating-point math are now fixed across the stack.
The runtime team shipped fixes for long-standing rounding failures that affected decimal-to-float conversions [1], BigInteger-to-double casts [2], and the new Decimal32/64/128 types [3]. The decimal fix is the most urgent: conversions like (double)10000000000000.099609375m were producing wrong results because intermediate rounding steps compounded precision loss. The BigInteger fix addresses a truncation bug that bypassed normal IEEE rounding entirely, affecting any code casting large integers to double. Meanwhile, MSBuild tightened partial evaluation semantics [5], restricting it to ProjectInstance to prevent cached Project objects from serving stale state. The MSBuild task analyzer package gained two new Roslyn rules [6] that flag string-based task parameters and suggest migration to typed alternatives (AbsolutePath, FileInfo, ITaskItem<T>), improving type safety in build logic. BenchmarkDotNet advanced to nightly build 0.16.0-nightly.20260703.576 [4] with a bump to Microsoft.Extensions 10.0.3 to resolve transitive dependency conflicts. All major repos (runtime, aspnetcore, sourcelink) flowed into dotnet/dotnet overnight [ref:15, ref:16, ref:17].
Action items
- → If you cast decimals or BigIntegers to floating-point types, rebuild with the latest runtime to verify precision dotnet/runtime [immediate]
- → Audit MSBuild task parameters for string-based paths and apply the new MSBuildTask0006/0007 analyzers dotnet/msbuild [plan]
- → Review any code using Project.PartialEvaluate; move to ProjectInstance if you need partial evaluation semantics dotnet/msbuild [plan]
References
- [1] Fix decimal to/from floating-point conversions to round correctly ↗ dotnet/runtime
- [2] Fix rounding of BigInteger conversions to floating-point types ↗ dotnet/runtime
- [3] Implement Decimal32/64/128 arithmetic and comparison operators ↗ dotnet/runtime
- [4] Update BenchmarkDotNet to 0.16.0-nightly.20260703.576 ↗ dotnet/performance
- [5] Restrict partial evaluation to ProjectInstance ↗ dotnet/msbuild
- [6] Add Roslyn analyzers (MSBuildTask0006/0007) to suggest typed task parameters ↗ dotnet/msbuild
- [7] [main] Source code updates from dotnet/sourcelink ↗ dotnet/dotnet
- [8] [main] Source code updates from dotnet/runtime ↗ dotnet/dotnet
- [9] [main] Source code updates from dotnet/aspnetcore ↗ dotnet/dotnet