Skip to content

Report Radix as 10, since the type is base 10 - #118

Merged
matt-edmondson merged 1 commit into
mainfrom
fix/radix-is-ten
Sep 27, 2026
Merged

matt-edmondson merged 1 commit into
mainfrom
fix/radix-is-ten

Conversation

@matt-edmondson

Copy link
Copy Markdown
Contributor

Fixes #116

What changed

  • PreciseNumber.Radix now returns 10 instead of 2. The constant is renamed from BinaryRadix to DecimalRadix.
  • TestRadix now expects 10. It pinned the wrong value before.

PreciseNumber stores significand × 10^exponent and does all of its digit work in base 10, which is also what decimal reports. Generic math code that reads T.Radix, for example to compute ulps or to decide whether scaling is exact, was treating the type as binary.

Behaviour change: this changes a public static value, and the commit subject carries that into the generated changelog.

Verification

  • TestRadix fails with the fix reverted (Assert.AreEqual(10, PreciseNumber.Radix)) and passes with it.
  • The full dotnet test suite passes: 385/385.

🤖 Generated with Claude Code

https://claude.ai/code/session_01M4xENzmZT4DZE8d5Hu6kEN


Generated by Claude Code

PreciseNumber stores significand × 10^exponent and does all its digit
work in base 10, like decimal, but Radix returned 2. Generic math code
that reads T.Radix treated it as binary.

Fixes #116

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M4xENzmZT4DZE8d5Hu6kEN

Copy link
Copy Markdown
Contributor Author

Analyze & Release failed on 0ca4ab3, and the cause is outside this PR. SonarCloud's scanner could not create the analysis because https://api.sonarcloud.io/analysis/analyses returned Error 504 … "Endpoint request timed out". The build and tests in that job, and the Test jobs on ubuntu, macOS and windows, all passed. The diff doesn't touch the Sonar setup, and there is no fix to port on our side. I've re-run the failed job once.


Generated by Claude Code

@sonarqubecloud

Copy link
Copy Markdown

@matt-edmondson
matt-edmondson merged commit 5decaa9 into main Sep 27, 2026
17 of 18 checks passed
@matt-edmondson
matt-edmondson deleted the fix/radix-is-ten branch September 27, 2026 00:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PreciseNumber.Radix returns 2, but the type is base 10 (significand × 10^exponent)

2 participants