title: What's the smallest non-zero, positive floating-point number in Perl?
body: <p>I have a program in Perl that works with probabilities that can occasionally be very small. Because of rounding error, sometimes one of the probabilities comes out to be zero. I'd like to do a check for the following:</p>
  
  <pre><code>use constant TINY_FLOAT =&gt; 1e-200;
  my $prob = calculate_prob();
  if ( $prob == 0 ) {
      $prob = TINY_FLOAT;
  }
  </code></pre>
  
  <p>This works fine, but I actually see Perl producing numbers that are smaller than 1e-200 (I just saw a 8.14e-314 fly by). For my application I can change calculate_prob() so that it returns the maximum of TINY_FLOAT and the actual probability, but this made me curious about how floating point numbers are handled in Perl. </p>
  
  <p>What's the smallest positive floating-point value in Perl? Is it platform-dependent? If so, is there a quick program that I can use to figure it out on my machine? </p>