Help for this page

Select Code to Download


  1. or download this
    $n <<= 1 while $n & 0xfff;
    
  2. or download this
        for( c = 1; ( ~n & 1 ) && ( c < 4096 ); c <<= 1 ) n >>= 1;
        lcm = n * 4096;
    
  3. or download this
        while( n & 0xfff ) n <<= 1;
        lcm = n;
    
  4. or download this
    C:\test\C>gcm
    gcm : 2132901888
    ...
    anonyM: gcm  for s=2147483648 & r=1 to 1073741824 took:33.850023994460
    anonyM: gcm2 for s=2147483648 & r=1 to 1073741824 took:46.293298113614
    anonyM: gcm3 for s=2147483648 & r=1 to 1073741824 took:64.208097030422
    
  5. or download this
    U64 gcm2( U64 max, U64 n ) {
        U32 b;
    ...
        lcm = n * 4096;
        return ( max / lcm ) * lcm;
    }
    
  6. or download this
    PUBLIC    gcm2
    ; Function compile flags: /Ogtpy
    ...
    
        ret    0
    gcm2    ENDP
    
  7. or download this
    PUBLIC    gcm
    ; Function compile flags: /Ogtpy
    ...
    
        ret    0
    gcm    ENDP
    
  8. or download this
    C:\test\C>gcm
    anonyM: gcm  for s=2147483648 & r=1 to 1073741824 took: 33.92063749171
    +5 
    anonyM: gcm2 for s=2147483648 & r=1 to 1073741824 took: 46.15194765908
    +9 
    oiskuu: gcm  for s=2147483648 & r=1 to 1073741824 took:330.49201177311
    +0