title: C long double in golang
body: <p>I am porting an algorithm from C to Go. And I got a little bit confused. This is the C function:</p>
  
  <pre><code>void gauss_gen_cdf(uint64_t cdf[], long double sigma, int n)
  {
      int i;
      long double s, d, e;
  
      //Calculations ...
  
      for (i = 1; i &lt; n - 1; i++) {
         cdf[i] = s;
      }   
  }
  </code></pre>
  
  <p>And in the for loop value "s" is assigned to element "x" the array cdf. How is this possible? As far as I know, a long double is a float64 (in the Go context). So I shouldn't be able to compile the C code because I am assigning an long double to an array which just contains uint64 elements. But the C code is working fine.</p>
  
  <p>So can someone please explain why this is working?</p>
  
  <p>Thank you very much.</p>
  
  <p>UPDATE:</p>
  
  <p>The original C code of the function can be found here: <a href="https://github.com/mjosaarinen/hilabliss/blob/master/distribution.c#L22" rel="nofollow noreferrer">https://github.com/mjosaarinen/hilabliss/blob/master/distribution.c#L22</a></p>