Infinities.jl
Infinities.jl copied to clipboard
A Julia package for representing infinity in all its forms
Since `RealInfinity` is being used as an index in https://github.com/JuliaArrays/InfiniteArrays.jl/blob/e323a66574662ae4b171cd8fc6822ad79e27ea8c/src/infarrays.jl#L119-L120, it makes sense to define `to_index` for it instead of extending `getindex`.
https://github.com/JuliaMath/Infinities.jl/blob/489b68b594f436f6b068c222939c9f537d20b928/src/cardinality.jl#L192 Aqua flags this method as potential type-piracy (see https://github.com/JuliaTesting/Aqua.jl/issues/173). I think this is fine, and the flag is a false positive, but why do we need this method? Is...
This change will make it easier to handle ambiguities and conflicts. Old interface is reserved, except for `x.signbit` fully replaced by `signbit(x)`. - #5
`Aqua` is set to check ambiguities. - Solves #36 Related changes: - Some tests change from `NotANumber` to `ArgumentError` #38 - Standalone `+∞` now refers to `RealInfinity()`. Some `+/-` test...
I think we could use more type: ```julia struct IntegerInfinity
This is fine: ``` julia> RealInfinity() - RealInfinity() ERROR: ArgumentError: Cannot subtract ∞ from ∞ Stacktrace: [1] -(x::RealInfinity, y::RealInfinity) @ Infinities ~/.julia/packages/Infinities/r8p4Q/src/Infinities.jl:195 [2] top-level scope @ REPL[12]:1 ``` This is...
Does these mean `ℵ₀` is strictly greater than `∞` while they are also equal? What is the purpose behind it? https://github.com/JuliaMath/Infinities.jl/blob/0972ead14abe0eee1218c6f5b2e244775bd9e4c8/test/test_cardinality.jl#L22 https://github.com/JuliaMath/Infinities.jl/blob/0972ead14abe0eee1218c6f5b2e244775bd9e4c8/test/test_cardinality.jl#L43 https://github.com/JuliaMath/Infinities.jl/blob/0972ead14abe0eee1218c6f5b2e244775bd9e4c8/test/test_cardinality.jl#L77-L78 https://github.com/JuliaLang/julia/blob/43d7f881f8e26eb4bb7ef3d6f84b378d28125325/base/promotion.jl#L532-L533
The readme says > `∞` to represent the positive real infinity. > `RealInfinity` to represent `±∞`. Does that mean `∞` and `+∞` are the same thing?
Is this behaviour intended? Why is it? https://github.com/JuliaMath/Infinities.jl/blob/0972ead14abe0eee1218c6f5b2e244775bd9e4c8/test/runtests.jl#L41 https://github.com/JuliaMath/Infinities.jl/blob/0972ead14abe0eee1218c6f5b2e244775bd9e4c8/test/runtests.jl#L163
I have another project depending on `Infinities.jl` and `Aqua` reports over 100 ambiguities. For example ```julia julia> ℵ₀==big(1) ERROR: MethodError: ==(::InfiniteCardinal{0}, ::BigInt) is ambiguous. Candidates: ==(i::Integer, x::BigInt) @ Base.GMP gmp.jl:698...