home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / perl_mlb.zip / integer.pm < prev    next >
Text File  |  1997-11-25  |  589b  |  33 lines

  1. package integer;
  2.  
  3. =head1 NAME
  4.  
  5. integer - Perl pragma to compute arithmetic in integer instead of double
  6.  
  7. =head1 SYNOPSIS
  8.  
  9.     use integer;
  10.     $x = 10/3;
  11.     # $x is now 3, not 3.33333333333333333
  12.  
  13. =head1 DESCRIPTION
  14.  
  15. This tells the compiler that it's okay to use integer operations
  16. from here to the end of the enclosing BLOCK.  On many machines, 
  17. this doesn't matter a great deal for most computations, but on those 
  18. without floating point hardware, it can make a big difference.
  19.  
  20. See L<perlmod/Pragmatic Modules>.
  21.  
  22. =cut
  23.  
  24. sub import {
  25.     $^H |= 1;
  26. }
  27.  
  28. sub unimport {
  29.     $^H &= ~1;
  30. }
  31.  
  32. 1;
  33.