title: typecast to single in MATLAB
body: <p>What does this call to <code>typecast</code> do in MATLAB?</p>
  
  <pre><code>y=typecast(x,'single');
  </code></pre>
  
  <p>what does it mean? When I run <code>typecast(3,'single')</code> it gives <code>0 2.1250</code>. </p>
  
  <p>I don't understand what that is. </p>
  
  <p>I am trying to convert this to Java, how can I do that?</p>
  
  <p>From the MATLAB manual:</p>
  
  <blockquote>
    <p>single - Convert to single precision</p>
    
    <p>Syntax</p>
  
  <pre><code>B = single(A)
  </code></pre>
    
    <p>Description</p>
    
    <p><code>B = single(A)</code> converts the matrix A
    to single precision, returning that
    value in B. A can be any numeric
    object (such as a double). If A is
    already single precision, single has
    no effect. Single-precision quantities
    require less storage than
    double-precision quantities, but have
    less precision and a smaller range.</p>
  </blockquote>