Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use distinct types for RealInfinity #37

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

putianyi889
Copy link

@putianyi889 putianyi889 commented Jun 6, 2023

This change will make it easier to handle ambiguities and conflicts. Old interface is reserved, except for x.signbit fully replaced by signbit(x).

@codecov
Copy link

codecov bot commented Jun 6, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (0972ead) 99.14% compared to head (cb8e5d9) 99.15%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master      #37   +/-   ##
=======================================
  Coverage   99.14%   99.15%           
=======================================
  Files           2        2           
  Lines         350      353    +3     
=======================================
+ Hits          347      350    +3     
  Misses          3        3           
Impacted Files Coverage Δ
src/Infinities.jl 99.55% <100.00%> (+<0.01%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@putianyi889 putianyi889 marked this pull request as draft June 11, 2023 10:53
@@ -107,15 +107,17 @@ function mod(x::Real, ::Infinity)
x
end

abstract type RealInfinity <: Real end
struct PositiveInfinity <: RealInfinity end
struct NegativeInfinity <: RealInfinity end

Choose a reason for hiding this comment

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

Good, this also makes those two types into singleton types, which may allow for better code in a few places (avoiding allocations)

@putianyi889 putianyi889 marked this pull request as ready for review November 5, 2023 09:02
@nsajko
Copy link
Contributor

nsajko commented Aug 31, 2024

Wouldn't this be a breaking change? Why not just introduce new types, and keep RealInfinity as is?

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.

3 participants