Help for this page

Select Code to Download


  1. or download this
    use 5.010;
    given( $number ) {
    ...
        when( /^[+-]?(?=\.?\d)\d*\.?\d*(?:e[+-]?\d+)?\z/i)
            { say "\tis a C float" }
    }
    
  2. or download this
    #!/usr/bin/perl
    use strict;
    ...
        print "The $number is a C float\n"; 
        }
    }
    
  3. or download this
    The 1 is a whole number
    The -1 has nondigits
    The 123.1 has nondigits
    The 0.1 has nondigits
    
  4. or download this
    The 1 is a +/- integer
    The -1 is a +/- integer
    The 123.1 is a C float
    The 0.1 is a C float
    
  5. or download this
    my @numbers = ("1", "-1", "123.1", "0.1");
    
    ...
    -1 is Float
    123.1 is Float
    0.1 is Float
    
  6. or download this
    #!/usr/bin/perl
    use strict;
    ...
    The 123.1 is a C float
    The 0.1 is a C float
    The Characters has nondigits
    
  7. or download this
    #!/usr/bin/perl
    use strict;
    ...
    The 123.1 is a C float
    The 0.1 is a C float
    The Characters has nondigits
    
  8. or download this
    #!/usr/bin/perl
    use strict;
    ...
                        Rate IfAndElsIfLoop     SwitchLoop
    IfAndElsIfLoop 4954766/s             --           -13%
    SwitchLoop     5691790/s            15%             --