title: Lua get number type
body: <p>In Lua, using the type function on any number always returns 'number'. Is there a function which can tell you whether the Lua interpreter is using a 32 bit floats, 64 bit doubles, integers or something else for the number type?</p>
  
  <p>I tried to write a function like this:</p>
  
  <pre class="lang-lua prettyprint-override"><code>function numbertype()
    local rational = 5 / 2
  
    if rational == 2 then
      -- equals 2
      return 'int'
    else
      -- about 2.5
      return 'double' -- but could it be a 32 bit float or something else?
    end
  end
  
  print(numbertype())
  </code></pre>
  
  <p>It can't yet detect the difference between floats, doubles and unknown types. How can I query to see if Lua's number type is equivalent to an int, float or double in Lua's interpreter? I would like it to work in pure Lua.</p>