Repository navigation
Return a POH from PH.ToPOH instead of a pOH dressed as a pH [major] - #496
Open
matt-edmondson wants to merge 1 commit into
Open
matt-edmondson wants to merge 1 commit into
matt-edmondson wants to merge 1 commit into
Conversation
ToPOH() put 14 - pH into a PH<T>, so every pH member misread it: the pOH of an acid reported IsBasic, printed as "pH 11", and its ToHydrogenConcentration() returned the hydroxide concentration. Add a POH<T> scale to logarithmic.json, generated like PH<T> with FromHydroxideConcentration/ToHydroxideConcentration, plus a ToPH() partial. ToPOH() now returns it, which is a breaking return-type change, so docs/migration-guide-6.0.md describes the move. Fixes #482. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017vfJW3DYWS7PHxcghEBi3T
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Fixes #482
PH<T>.ToPOH()stored14 − pHin aPH<T>, so every pH member misread it. The pOH of an acid reportedIsBasic == true, printed aspH 11, andToHydrogenConcentration()returned the hydroxide concentration.This takes the issue's second option, which the triage comment preferred because it fits the generated logarithmic-scale pattern:
POH<T>entry inlogarithmic.json. It is generated likePH<T>, withFromHydroxideConcentrationandToHydroxideConcentration, and prints aspOH {0}.Chemistry/POH.csaddsToPH(), which gives14 − pOHat 25 °C.PH<T>.ToPOH()now returnsPOH<T>.POH<T>has noIsAcidic,IsBasicor pH formatting.verify-generatedsees no diff.docs/migration-guide-6.0.mdcovers the breaking return type, andCLAUDE.mdaddsPOHto its list of logarithmic scales.Tests
POH_Of_An_Acid_Is_A_POH_And_Converts_Back: the pOH ofPH.Create(3)is 11, prints aspOH …, gives [OH⁻] = 1e-11 mol/L, and converts back to an acidic pH 3.POH_From_Hydroxide_Concentration_And_Back: round-trips through the hydroxide concentration.PH.csreverted tomain, the new test does not compile (CS0029: Cannot implicitly convert type 'PH<double>' to 'POH<double>'). With the fix it passes.Semantics.Test: 1946 passed, 0 failed, 14 skipped.Semantics.Cpp.Test: 45 passed. The one remaining error is a missing older .NET runtime in this container.Open PR #493 is also
[major]. If both merge for the same release, its notes belong in the samemigration-guide-6.0.md.Generated by Claude Code