JuliaMath / JuliaMath/Infinities.jl
Discussing some choices made so far
- Dominant language
- Julia
- Stars
- 22
- Forks
- 10
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 7
Description
Thanks for starting this package. I've been getting used to it before adding my stuff.
Here are a few things I've noticed in the implementation so far that I think need to be justified or addressed:
1. Is `NotANumber` really necessary? Why not just raise an exception?
2. I don't think we should have constructors `RealInfinity(signbit::Bool)` and `ComplexInfinity(angle::Real)`: the convention in Julia Base is that for a numeric type `T` that `T(x::Number)` is the same as `convert(T, x)`. There should be constructors private to the module called `realinffromsignbit` or something.
3. Why is there checked arithmetic when this is for integers, and infinity is not an integer?
4. Why is `fld(x, Infinity()) == -1` when `x<0`? I am guessing that you are defining `fld(x, Infinity())` as the limit as `y` gets big of `fld(x, y)`, but an equally good definition is simply that it is `floor(x / Infinity()) == 0`. The latter definition is the one in the Julia documentation, and arguably the one people would expect.
5. Given `ComplexInfinity` is not ordered, why are `mod`, `div`, `fld`, `isless`, `<`, `min`, etc. defined? They aren't defined for `Complex`.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.