Skip to content

Division with ∞ - #68

Open
dlfivefifty wants to merge 6 commits into
masterfrom
division-with-∞

Hidden character warning

The head ref may contain hidden characters: "division-with-\u221e"
Open

Division with ∞#68
dlfivefifty wants to merge 6 commits into
masterfrom
division-with-∞

Conversation

@dlfivefifty

Copy link
Copy Markdown
Member

No description provided.

@codecov

codecov Bot commented Dec 21, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.85714% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 98.69%. Comparing base (88706fc) to head (ae634a1).
⚠️ Report is 7 commits behind head on master.

Files with missing lines Patch % Lines
src/Infinities.jl 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master      #68      +/-   ##
==========================================
- Coverage   99.08%   98.69%   -0.39%     
==========================================
  Files           6        6              
  Lines         218      230      +12     
==========================================
+ Hits          216      227      +11     
- Misses          2        3       +1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

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

@PatrickHaecker PatrickHaecker left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not yet proposing changes, because I still don't really understand the interaction with #82, but this should not be merged as is and parts of it will probably be obsolete due to #82 (sorry for not checking #68 before implementing #82).

Comment thread src/Infinities.jl
convert(::Type{ComplexInfinity}, ::Infinity) = ComplexInfinity()
convert(::Type{ComplexInfinity{T}}, x::RealInfinity) where T = ComplexInfinity{T}(x)
convert(::Type{ComplexInfinity}, x::RealInfinity) = ComplexInfinity(x)
float(x::ComplexInfinity) = exp(im*angle(x)) * Inf

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not correct:

julia> float(ComplexInfinity())
Inf + NaN*im

PatrickHaecker pushed a commit to PatrickHaecker/Infinities.jl that referenced this pull request Sep 4, 2026
Gaps that JuliaMath#68 covers and this branch did not, plus the types they missed.

`round(x, ::RoundingMode)` was a MethodError, and `round(x; digits)` fell
through to `Base` and returned `Inf` rather than the infinity, disagreeing with
the plain `round(x)` next to it. `isinteger` and the four rounding functions
also answered for `Infinity` and `RealInfinity` alone, so a `ComplexInfinity`
raised a MethodError where `Base` answers `false` and the value itself for the
matching `Complex`, and `ℵ₀` took a rounding mode but not the keywords.

`float(::ComplexInfinity)` was a MethodError, the real infinities having got
theirs from the `AbstractFloat` conversion. JuliaMath#68 proposes `exp(im*angle(x))*Inf`,
which is unsound: `0 * Inf` is a `NaN`, so `float(ComplexInfinity())` gives
`Inf + NaN*im`, and the imaginary and negative real axes come back as diagonals.
`cospi`/`sinpi` are exact at the half-integers, so building the parts from them
keeps the axes exact. Two saturating parts can express only eight rays, so an
angle off them lands on the nearest one, which the test pins.
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.

2 participants