Help for this page

Select Code to Download


  1. or download this
    use Config     qw( %Config );
    use List::Util qw( max );
    
    my $max = max( ~0+1, eval( $Config{ nv_overflows_integers_at } ) );
    
  2. or download this
    [+/-]1._____..._____ * 2**____
    
  3. or download this
         __52 bits__
        /           \
    ...
      1.00000...000001 * 2**53    But we have limited number of bits
    --------------------------
      1.00000...00000  * 2**53    Original large power of two
    
  4. or download this
    $ perl -MB=svref_2object,SVf_IVisUV,SVf_NOK -e'
       $i = 0;
    ...
          :                            "IV\n";  # Signed int
    '
    IV
    
  5. or download this
    $ perl -MConfig -MB=svref_2object,SVf_IVisUV,SVf_NOK -e'
       $i = hex("7F".("FF"x($Config{ivsize}-2))."FD");
    ...
    IV 2147483647            <-- 2**31 - 1  Largest IV
    UV 2147483648
    UV 2147483649
    
  6. or download this
    IV 9223372036854775806
    IV 9223372036854775807   <-- 2**63 - 1  Largest IV
    UV 9223372036854775808
    UV 9223372036854775809
    
  7. or download this
    $ perl -V:[in]vsize
    ivsize='4';   # 32-bit integers
    nvsize='8';   # 64-bit floats
    
  8. or download this
    $ perl -V:[in]vsize
    ivsize='8';   # 64-bit integers
    nvsize='8';   # 64-bit floats
    
  9. or download this
    $ perl -MConfig -MB=svref_2object,SVf_IVisUV,SVf_NOK -e'
       $i = eval($Config{nv_overflows_integers_at}) - 3;
    ...
    NV 9007199254740991                 Precision required as a float:
    NV 9007199254740992  <-- 2**53      1 bit
    NV 9007199254740992  <-- 2**53 + 1  54 bits, but only 53 are available
    
  10. or download this
    $ perl -MConfig -MB=svref_2object,SVf_IVisUV,SVf_NOK -e'
       $i = hex(("FF"x($Config{ivsize}-1))."FD");
    ...
    UV 18446744073709551615  <-- 2**64 - 1  Largest UV
    NV 18446744073709551616  <-- 2**64      1 bit of precision required
    NV 18446744073709551616  <-- 2**64 + 1  65, but only 53 are available