Re: [julia-users] linspace question; bug?

2016-10-15 Thread Stefan Karpinski
On Fri, Oct 14, 2016 at 8:17 PM, Páll Haraldsson wrote: > > Nobody makes a one element linspace intentionally, but would it be bad to > allow it? > Yes, it's better to raise an error when asked to do something that makes no sense than to do some arbitrary wrong thing.

Re: [julia-users] linspace question; bug?

2016-10-14 Thread Páll Haraldsson
2016-10-14 22:58 GMT+00:00 Stefan Karpinski : > I'll answer your question with a riddle: How can you have a length-one > collection whose first and last value are different? > I know that; yes, it's a degenerate case, and as I said "may not matter too much" [Nobody makes a

Re: [julia-users] linspace question; bug?

2016-10-14 Thread Stefan Karpinski
I'll answer your question with a riddle: How can you have a length-one collection whose first and last value are different? On Fri, Oct 14, 2016 at 6:25 PM, Páll Haraldsson wrote: > > I mistook third param for step, and got confusing error: > > > julia> linspace(1, 2,

[julia-users] linspace question; bug?

2016-10-14 Thread Páll Haraldsson
I mistook third param for step, and got confusing error: julia> linspace(1, 2, 1) ERROR: linspace(1.0, 2.0, 1.0): endpoints differ in linspace(::Float64, ::Float64, ::Float64) at ./range.jl:212 in linspace(::Float64, ::Float64, ::Int64) at ./range.jl:251 in linspace(::Int64, ::Int64,