-
Notifications
You must be signed in to change notification settings - Fork 7
Closed
Description
This package would seem to be a good fit for solving this Discourse question. It's easy to see that we should be able to represent 10^(10^100), since
julia> m = exp(ULogarithmic, floatmax(BigFloat))
exp(5.875653789111587590936911998878442589938516392745498308333779606469323584389875e+1388255822130839282)
julia> log10(log10(m))
1.388255822130839282406840509258088745814167339601572288185265795534139656091031e+18But when I try, I get
julia> ten = ULogarithmic(big(10.0))
exp(2.302585092994045684017991454684364207601101488628772976033327900967572609677367)
julia> ten^(ten^100)
ERROR: StackOverflowError:
Stacktrace:
[1] promote_type(#unused#::Type{BigFloat}, #unused#::Type{Logarithmic{BigFloat}})
@ Base ./promotion.jl:298
[2] promote_result(#unused#::Type, #unused#::Type, #unused#::Type{BigFloat}, #unused#::Type{Logarithmic{BigFloat}})
@ Base ./promotion.jl:312
--- the last 2 lines are repeated 39990 more times ---
[79983] promote_type(#unused#::Type{BigFloat}, #unused#::Type{Logarithmic{BigFloat}})
@ Base ./promotion.jl:298At this scale, log2 also has trouble:
julia> log(m)
5.875653789111587590936911998878442589938516392745498308333779606469323584389875e+1388255822130839282
julia> log10(m)
2.551764018185095407552308798312362545661809468659242820931240956675926749716967e+1388255822130839282
julia> log2(m)
InfMetadata
Metadata
Assignees
Labels
No labels