Skip to content

NuGet package polish: square icon, dedicated readme, culture-safe formatting - #4

Merged
InfoTCube merged 2 commits into
mainfrom
nuget-polish
Aug 17, 2026
Merged

InfoTCube merged 2 commits into
mainfrom
nuget-polish

Conversation

@InfoTCube

Copy link
Copy Markdown
Owner

Follow-up to #3, all found while verifying the packed .nupkg.

Square icon

The package used qubitnet.png, which is 1024x363. nuget.org renders the icon in a square
slot, so the banner was letterboxed. Switched to the 512x512 qubitnet-icon-512.png; the
banner stays as the GitHub readme header.

Dedicated package readme

nuget.org cannot resolve relative links or images, so the repo readme rendered there with a
broken logo. It is also 400 lines — the package page works better as a funnel to GitHub
than as full documentation.

Added README.nuget.md, packed as the readme: value proposition, install, quick start,
Unity, algorithms, QASM, and a link to GitHub for the rest.

Culture-safe formatting

Packaging the readme exposed a real bug in the output it showcases. FormatComplex used
double.ToString() with the current culture and full precision, so a Bell state printed as:

0,7071067811865475|00> + 0,7071067811865475|11>

on any machine with a comma decimal separator — which is most of Europe, including the
machine this was developed on. Now:

0.7071|00> + 0.7071|11>

Three fixes in Helpers.FormatComplex:

  • Invariant culture, so output no longer varies by machine
  • Four decimal places instead of 17 significant digits
  • Amplitudes below 1e-10 are dropped. Applying H twice leaves ~1e-17 in the other
    amplitude, which previously printed as 1E-17|1>. H(0); H(0); now correctly reads |0>
  • A negative imaginary part reads 0.5 - 0.5i rather than 0.5 + -0.5i

Tests

+9, including one that asserts output is identical under pl-PL, de-DE and en-US.
Total 149 → 158.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Mhwc4XeGtzM2UQx9sNLb3r

InfoTCube and others added 2 commits August 17, 2026 21:22
…tting

- Use the 512x512 icon for the package. The 1024x363 banner was letterboxed in
  nuget.org's square icon slot; the banner stays as the GitHub readme header.
- Ship README.nuget.md as the package readme. nuget.org cannot resolve relative
  links or images, so the repo readme rendered with a broken logo, and the
  package page is a funnel to GitHub rather than a place for 400 lines of docs.
- Made the repo readme's logo an absolute URL for the same reason.

Packaging the readme exposed that the showcased ToString() output was wrong on
most machines: it used the current culture's decimal separator and printed full
double precision, so a Bell state read 0,7071067811865475|00> rather than
0.7071|00>. Formatting is now invariant and rounded, amplitudes that are only
numerical noise are dropped instead of printed as 1E-17, and a negative
imaginary part reads "a - bi" rather than "a + -bi".

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Mhwc4XeGtzM2UQx9sNLb3r
netstandard2.0 reaches .NET Framework 4.6.1+, Mono, Godot and Unity 2018-2020,
which netstandard2.1 leaves out. It compiles with no changes and no warnings —
dropping BitOperations.PopCount earlier was the only blocker — and the package
still has zero dependencies.

Skipped net9.0: it went out of support in May 2026, and a .NET 9 app resolves
the net8.0 asset anyway. net6/net7 likewise resolve netstandard2.1.

Version is 1.0.1 because 1.0.0 is already on nuget.org and NuGet never allows a
version to be re-pushed.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Mhwc4XeGtzM2UQx9sNLb3r
@InfoTCube
InfoTCube merged commit 434ecb8 into main Aug 17, 2026
1 check passed
@InfoTCube
InfoTCube deleted the nuget-polish branch August 17, 2026 19:28
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.

1 participant