Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The issue was that doing `one(p) << p` where p is Int produces zero on a 32-bit system if p is larger than 32, which it can be for some Float64 arguments. Getting tests to pass for 32-bit also required avoiding taking the length of LinSpace objects whose lengths are 2^31 or longer. This is a bit of a more general problem since we can represent FloatRange and LinSpace objects whose length cannot be represented as an Int on both 64- and 32-bit platforms, although it is, of course, easier to encounter the problem on 32-bit systems. In fact, on 64-bit systems it is not actually possible to construct LinSpace{Float64} objects whose length cannot be represented as an Int. The issue does exist for FloatRange on 64-bit systems, however. One possible solution is to introduce length(T,x) that gives lengths in a particular type and just define length(x) as length(Int,x) as the default behavior.
- Loading branch information