How to understand place of numbers with Irrational type in Julia?

There is nothing magical going on, these are just singletons for representing some irrational numbers of special significance that delay or elide the actual computation. Looking at the generic framework and the specific implementation for some of them tells most of the story: eg

==(::Irrational{s}, ::Irrational{s}) where {s} = true
==(::AbstractIrrational, ::AbstractIrrational) = false

so things like

julia> ℯ == π
false

will happen at compile time, and some identities are encoded, eg

Base.log(::Irrational{:ℯ}) = 1

but otherwise operations will just fall back to conversion to Float64 or the applicable numeric type (if there is one).

The Base docs talk about them briefly, but otherwise I would just treat them as an implementation detail.

4 Likes