You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Reading .Message from Log(x, newBase)'s domain error throws OverflowException for an extreme argument: #197's two new checks bypass DomainError (regression of #190) #202
ArgumentOutOfRangeException.Message then formats the value with fixed-point ToString(), which is the #190 failure. #192 moved every domain check onto DomainError (line 91). #197 (bc7471f, fixing #196) landed in parallel and added these two throws without it. CLAUDE.md states that every domain check builds its exception through DomainError.
Suggested fix / acceptance
Change both throws to throw DomainError(nameof(x), x, NonPositiveLogarithmMessage); and throw DomainError(nameof(newBase), newBase, NonPositiveLogarithmMessage);.
Add cases to PreciseNumberDomainErrorTests for Log(x, base) with an extreme bad x and with an extreme bad newBase. In both, .Message must stay short and must not throw.
Update TestLogInABaseNamesTheArgumentOutsideTheDomain. It asserts ActualValue == -2, but with the fix ActualValue holds the rendered string ("-2E+000").
Priority: Medium. Reading .Message from an expected domain-error exception throws a second, unrelated OverflowException, which breaks logging and catch handlers. It happens only for extreme arguments to Log(x, newBase). The fix is two lines.
Activity
matt-edmondson commentedon Nov 12, 2026
Triage
.Messagefrom an expected domain-error exception throws a second, unrelatedOverflowException, which breaks logging and catch handlers. It happens only for extreme arguments toLog(x, newBase). The fix is two lines.PreciseNumber/PreciseNumber.Exponentials.cslines 224 and 229, which bypassDomainError. Name newBase, not x, when Log is given a base outside its domain [patch] #197 and Render a domain error's argument in E notation, so its message stays short [patch] #192 crossed in parallel.DomainError, add the extreme-xand extreme-newBasecases toPreciseNumberDomainErrorTests, and update theActualValueassertion inTestLogInABaseNamesTheArgumentOutsideTheDomain. It could ship in one patch with Parse accepts a NUL inside the exponent when white space, a sign or a currency symbol follows:"3e1\0 "parses as 30 and"3e1\0-"as -30, where decimal and double throw #203 and Parse rejects a currency symbol outside the parentheses:"$(45)","(45)$"and"$ (45)"under Currency throw where decimal, double, long and BigInteger give -45 #204.Generated by Claude Code