title: Problems with digits in perl
body: <p>I have an array (@BondLength) of integers with about 14 digits each:</p>
  
  <pre><code>1.4913648111713
  1.49444103262725
  1.49324445420032
  1.49781641064584
  1.49375901670919
  1.48388476641551
  1.49205194279556
  1.48573550809019
  1.48486531375745
  1.48899462725693
  1.48455818343371
  1.49451162591664
  1.49687975468973
  1.48919777061343
  1.48460466118088
  </code></pre>
  
  <p>I put them as the "data" field, plus their "average" (which I was also successfully able to get to 10-digits) into a subroutine:</p>
  
  <pre><code>sub stdev{
      my($data) = @_;
      my $average = $_;
      if(@$data == 1){
              return 0;
      }
      my $sqtotal = 0;
      foreach(@$data) {
              $sqtotal += ($average-$_) ** 2;
      }
      my $std = ($sqtotal / (@$data-1)) ** 0.5;
      return $std;
  }
  </code></pre>
  
  <p>But when I call this subroutine with the necessary parameters:</p>
  
  <pre><code> my $stdev = &amp;stdev(@BondLength, $average);
  printf("\nThe standard deviation NCABondLength: $stdev");
  </code></pre>
  
  <p>I get simply "0" outputted. I know it has values larger than zero up to the tenth-decimal place because I inputted it into Excel. What am I doing wrong in this script? (I have tinkered with it too much now by reading things off the web, but still keep getting "0"). </p>
  
  <p>Thanks.</p>