Help for this page

Select Code to Download


  1. or download this
    # First make the program know the two numbers:
    $Number1 = 48;
    ...
    $Result = $Number1 / $Number2;
    
    # ...and look if we got a decimal:
    
  2. or download this
    # Using your sub
    is_integer_string($Result)
    ...
    
    # Check if the number is the same as its integer part:
    $Result == int($Result)
    
  3. or download this
    if (condition) { print "Yes"; } else { print "No"; }
    
  4. or download this
    sub is_integer_string {
     my $N = $_[0] + 0;
     return $N =~ /^\-?\d+$/;
    }