Skip to content

warn against @irrational #47103

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

Merged
merged 4 commits into from
Oct 10, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions base/irrationals.jl
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,14 @@ and arbitrary-precision definition in terms of `BigFloat`s given by the expressi
An `AssertionError` is thrown when either `big(def) isa BigFloat` or `Float64(val) == Float64(def)`
returns `false`.

!!! warning
This macro should not be used outside of `Base` Julia.

The macro creates a new type `Irrational{:sym}` regardless of where it's invoked. This can
lead to conflicting definitions if two packages define an irrational number with the same
name but different values.


# Examples
```jldoctest
julia> Base.@irrational(twoπ, 6.2831853071795864769, 2*big(π))
Expand Down