Skip to content

The imaginary part of a value that does not exist has none - #2257

Open
Rafael-SOWNet wants to merge 1 commit into
masterfrom
the-imaginary-part-of-nan-has-no-value
Open

Rafael-SOWNet wants to merge 1 commit into
masterfrom
the-imaginary-part-of-nan-has-no-value

Conversation

@Rafael-SOWNet

Copy link
Copy Markdown
Member

Im of a value that does not exist was 0. Imf.ImaginaryPart answered any Complex with its imaginary part, and NaN is a Real, whose imaginary part is 0. A NaN argument is now NaN.

master this branch
"Im(1/0)".ToEntity().Evaled 0 NaN
"Im(x)".ToEntity().Substitute("x", "1/0").Evaled 0 NaN
"Im(arccos(pi) provided pi < 3)".ToEntity().Evaled 0 NaN

Re, conj, arg, abs and floor of these were already NaN. Im is new since 2.6.0 (#2145), where im(1/0) was the product im * (1/0), so no answer changes against 2.6.0 and there is no BREAKING entry.

ImaginaryPartOfNaNTest: four cases fail on master, and four that pin unchanged values pass on both. Suite 18180 passed. The F# wrapper suite, the Mcp, Terminal and InteractiveWrapper suites and the AOT smoke test pass. Found by a new workspace harness, work/domaincheck.

Fixes #2253.

🤖 Generated with Claude Code

Im(1/0) was 0, and so was Im(arccos(pi) provided pi < 3), where Re,
conj, arg, abs and floor of the same values are NaN. Imf.ImaginaryPart
answered any Complex with its imaginary part, and NaN is a Real, whose
imaginary part is 0. A NaN argument is now NaN, before that arm.

ImaginaryPartOfNaNTest takes Im of three values that do not exist,
evaluated, simplified and substituted, and four of them fail on master.
Re(1/0) and the imaginary parts of 2 + 3i, 5 and -oo pin what has not
changed. Im is new since 2.6.0 (#2145), where im(1/0) was the product
im * (1/0), so no answer changes against it.

Found by work/domaincheck.

Fixes #2253.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@Rafael-SOWNet Rafael-SOWNet added this to the 2.7.0 milestone Oct 30, 2026
@Rafael-SOWNet Rafael-SOWNet moved this from Todo to In review in AngouriMath Oct 30, 2026
@codecov

codecov Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.71%. Comparing base (b035ed1) to head (043b02d).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2257   +/-   ##
=======================================
  Coverage   86.71%   86.71%           
=======================================
  Files         310      310           
  Lines       67790    67794    +4     
  Branches    19666    19666           
=======================================
+ Hits        58786    58790    +4     
+ Misses       4892     4891    -1     
- Partials     4112     4113    +1     
Flag Coverage Δ
cpp 37.77% <ø> (ø)
csharp 87.26% <100.00%> (+<0.01%) ⬆️
fsharp 32.97% <ø> (ø)
interactive 40.72% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...nuous/Evaluation.Continuous.Arithmetics.Classes.cs 87.03% <100.00%> (+0.04%) ⬆️

... and 4 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In review

Development

Successfully merging this pull request may close these issues.

The imaginary part of a value that does not exist is 0

1 participant