Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
844 B

  1. package integer;
  2. =head1 NAME
  3. integer - Perl pragma to compute arithmetic in integer instead of double
  4. =head1 SYNOPSIS
  5. use integer;
  6. $x = 10/3;
  7. # $x is now 3, not 3.33333333333333333
  8. =head1 DESCRIPTION
  9. This tells the compiler to use integer operations
  10. from here to the end of the enclosing BLOCK. On many machines,
  11. this doesn't matter a great deal for most computations, but on those
  12. without floating point hardware, it can make a big difference.
  13. Note that this affects the operations, not the numbers. If you run this
  14. code
  15. use integer;
  16. $x = 1.5;
  17. $y = $x + 1;
  18. $z = -1.5;
  19. you'll be left with C<$x == 1.5>, C<$y == 2> and C<$z == -1>. The $z
  20. case happens because unary C<-> counts as an operation.
  21. See L<perlmod/Pragmatic Modules>.
  22. =cut
  23. sub import {
  24. $^H |= 1;
  25. }
  26. sub unimport {
  27. $^H &= ~1;
  28. }
  29. 1;