Skip to content

Commit

Permalink
Merge pull request #52 from jishnub/to_index
Browse files Browse the repository at this point in the history
to_index for RealInfinity
  • Loading branch information
jishnub authored Dec 2, 2024
2 parents eb0e5bb + 6171be4 commit d72b52b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Infinities"
uuid = "e1ba4f0e-776d-440f-acd9-e1d2e9742647"
authors = ["Sheehan Olver <[email protected]>"]
version = "0.1.8"
version = "0.1.9"

[compat]
Aqua = "0.8"
Expand Down
2 changes: 2 additions & 0 deletions src/Infinities.jl
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ angle(x::RealInfinity) = π*signbit(x)
string(y::RealInfinity) = signbit(y) ? "-∞" : "+∞"
show(io::IO, y::RealInfinity) = print(io, string(y))

Base.to_index(i::RealInfinity) = convert(Integer, i)

#######
# ComplexInfinity
#######
Expand Down
2 changes: 2 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,8 @@ using Aqua
@test convert(Float16, -∞) Float16(-∞) -Inf16
@test convert(BigFloat, -∞)::BigFloat == BigFloat(-∞)::BigFloat == -BigFloat(Inf)
end

@test Base.to_index(RealInfinity()) ℵ₀
end

@testset "ComplexInfinity" begin
Expand Down

4 comments on commit d72b52b

@jishnub
Copy link
Member Author

@jishnub jishnub commented on d72b52b Dec 2, 2024

Choose a reason for hiding this comment

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

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

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

Error while trying to register: Register Failed
@jishnub, it looks like you are not a publicly listed member/owner in the parent organization (JuliaMath).
If you are a member/owner, you will need to change your membership to public. See GitHub Help

@jishnub
Copy link
Member Author

@jishnub jishnub commented on d72b52b Dec 2, 2024

Choose a reason for hiding this comment

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

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

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

Registration pull request created: JuliaRegistries/General/120528

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.1.9 -m "<description of version>" d72b52b67ddbc422c2e4f74a2a4583b03e3b4c2b
git push origin v0.1.9

Please sign in to comment.