Looking at your and Yichao's responses, I think my definition of Range is poor/wrong.
I just wanted a type that denoted every element of the same type between the start and stop point (inclusive). So e.g. an input of (0.0, 1.0) would denote the set of every Float64 between 0.0 and 1.0, and (4, 7) would denote the Ints 4, 5, 6, 7, and so on. It sounds like there is no type in Base that does this, and ValidatedNumerics and Unums sound like over-kill based on their github pages. I think I'll just implement it myself - I'm sure it'll only be about 5-10 lines of code. Cheers and thanks for responding, Colin On Friday, 3 June 2016 12:53:40 UTC+10, Tom Breloff wrote: > > It seems like you're misusing Range here. Maybe you want to look at > ValidatedNumerics or Unums? What's your use-case? > > On Thursday, June 2, 2016, <[email protected] <javascript:>> wrote: > >> Hi all, >> >> Is there any way to build a range that corresponds to the mathematical >> set (-Inf, Inf)? I had a look at the source code in range.jl (which is very >> readable!) and it doesn't appear that any of the Range types is suitable to >> this task, e.g. StepRange doesn't take Float64 inputs, UnitRange(-Inf, Inf) >> returns the range (-Inf, NaN) since the constructor returns convert >> (T,start+floor(stop-start)) for the stop value (I'm presuming for good >> reasons that I'm not smart enough to understand), and FloatRange needs >> concepts like step, len, and divisor that aren't well defined in this >> context. >> >> Cheers, >> >> Colin >> >> >>
