title: Simple: How do doubles work in Perl?
body: <p>I am very confused about how decimal numbers work in perl. I'm having trouble multiplying an int with a double. Here's what I have:</p>
  
  <pre><code>sub timeEstimate(){
  $number = shift;
  print "Number: $number\n";
  $stuff = sprintf("%d", $number * $number * $number) * .2045;
  print "stuff: $stuff\n";
  $totalDownloads = $stuff + ($number * $number) + $number;
  print "totalDownloads: $totalDownloads\n";
  $secondPerFile = .4464;
  print "secondPerFile: $secondPerFile\n";
  $totalSeconds = ($totalDownloads * $secondPerFile);
  print "totalSeconds: $totalSeconds\n";
  $totalHours = ($totalSeconds / 3600);
  print "totalHours: $totalHours\n";
  return $totalHours;
  }
  </code></pre>
  
  <p>But no matter what I try, even sprintf, I still can't get $stuff to be anything but 0. Could someone explain how the system works?</p>
  
  <p>UPDATE-Solved: Due to stupid self-inflicted mistake. I had </p>
  
  <pre><code>use integer; 
  </code></pre>
  
  <p>in the code. <em>headdesk</em></p>