Stefan, To expand now I have a non-phone keyboard ;-S
First of all you are right about 10. my bad. My question was "does Julia always use float64 even if its a 32 bit build?" so that a real can be assumed to at least be that size. For float32 the integers only go up to 16 million. Of more concern is that a real used for indexing would be likely to be calculated, I would have thought type inference would give an integer for simple index situations. So the concern is more about what happens when a calculated real is not quite exactly the integer? Cheers Lex On Monday, March 16, 2015 at 9:34:57 AM UTC+10, Stefan Karpinski wrote: > > On Sun, Mar 15, 2015 at 7:24 PM, <ele...@gmail.com <javascript:>> wrote: > >> The problem is that its fairly easy to be casually wrong when using reals >> as indexes. What does 10. index? (Hint: floating point numbers can't >> represent 10 exactly, its 9.999999...) > > > This is simply untrue. All integers between ±2^53 can be represented > exactly as Float64s. Beyond that, many integers can be represented exactly, > but not all of them. >