title: Generic Float type in Julia language?
body: <p>My question is simple, is there a generic <code>Float</code> type in julia? For the case of <code>Integer</code>s, for example, one can simply write <code>Int</code> and it will be translated as <code>Int32</code> in 32-bit systems or <code>Int64</code> in 64-bit systems. For <code>Float</code>s though, see the example function below:</p>
  
  <pre><code>function bb(n)
      b = Array{Float64}(n) 
      b[1] = 0.9999
      for i = 2:n
          @inbounds b[i] = b[i-1] * 0.9999
      end    
      println(b[n])
  end
  
  bb(10^3)
  @time bb(10^3)
  @time bb(10^8)
  </code></pre>
  
  <p>It gives the following timing results along with total memory allocations:</p>
  
  <pre><code>0.9048328935585562
  0.9048328935585562
    0.000100 seconds (135 allocations: 15.750 KB)
  2.4703e-320
    3.230642 seconds (14 allocations: 762.940 MB, 1.51% gc time)
  </code></pre>
  
  <p>Now change the first line to <code>b = Array{AbstractFloat}(n)</code> and see the ridiculously huge timings and memory allocations:</p>
  
  <pre><code>0.9048328935585562
  0.9048328935585562
    0.003564 seconds (2.13 k allocations: 46.953 KB)
  2.4703e-320
    351.068176 seconds (200.00 M allocations: 3.725 GB, 0.74% gc time)
  </code></pre>
  
  <p>There is nothing as <code>b = Array{Float}(n)</code> I can use, the only solution I came up with is this non-elegant notation <code>b = Array{typeof(1.0)}(n)</code>.</p>