Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 5 of 5 for trailingZeroBits (0.21 sec)

  1. src/math/big/prime.go

    // The number n is known to be non-zero.
    func (n nat) probablyPrimeMillerRabin(reps int, force2 bool) bool {
    	nm1 := nat(nil).sub(n, natOne)
    	// determine q, k such that nm1 = q << k
    	k := nm1.trailingZeroBits()
    	q := nat(nil).shr(nm1, k)
    
    	nm3 := nat(nil).sub(nm1, natTwo)
    	rand := rand.New(rand.NewSource(int64(n[0])))
    
    	var x, y, quotient nat
    	nm3Len := nm3.bitLen()
    
    NextRandom:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Nov 02 14:43:52 UTC 2022
    - 10.4K bytes
    - Viewed (0)
  2. src/math/big/int.go

    	// changes must be reviewed by a security expert.
    	return x.abs.bitLen()
    }
    
    // TrailingZeroBits returns the number of consecutive least significant zero
    // bits of |x|.
    func (x *Int) TrailingZeroBits() uint {
    	return x.abs.trailingZeroBits()
    }
    
    // Exp sets z = x**y mod |m| (i.e. the sign of m is ignored), and returns z.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 14 17:02:38 UTC 2024
    - 33.1K bytes
    - Viewed (0)
  3. src/math/big/ratconv.go

    	d := x.Denom().abs // d >= 1
    
    	// Determine p2 by counting factors of 2.
    	// p2 corresponds to the trailing zero bits in d.
    	// Do this first to reduce q as much as possible.
    	var q nat
    	p2 := d.trailingZeroBits()
    	q = q.shr(d, p2)
    
    	// Determine p5 by counting factors of 5.
    	// Build a table starting with an initial power of 5,
    	// and use repeated squaring until the factor doesn't
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Nov 15 22:16:34 UTC 2023
    - 12.3K bytes
    - Viewed (0)
  4. src/math/big/nat.go

    		top |= top >> 16
    		top |= top >> 16 >> 16 // ">> 32" doesn't compile on 32-bit architectures
    		return i*_W + bits.Len(top)
    	}
    	return 0
    }
    
    // trailingZeroBits returns the number of consecutive least significant zero
    // bits of x.
    func (x nat) trailingZeroBits() uint {
    	if len(x) == 0 {
    		return 0
    	}
    	var i uint
    	for x[i] == 0 {
    		i++
    	}
    	// x[i] != 0
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 13 21:31:58 UTC 2024
    - 31.7K bytes
    - Viewed (0)
  5. src/math/big/float.go

    // The result is 0 for |x| == 0 and |x| == Inf.
    func (x *Float) MinPrec() uint {
    	if x.form != finite {
    		return 0
    	}
    	return uint(len(x.mant))*_W - x.mant.trailingZeroBits()
    }
    
    // Mode returns the rounding mode of x.
    func (x *Float) Mode() RoundingMode {
    	return x.mode
    }
    
    // Acc returns the accuracy of x produced by the most recent
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Jun 06 15:46:54 UTC 2024
    - 44.5K bytes
    - Viewed (0)
Back to top