Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for trailingZeroBits (0.25 sec)

  1. 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)
  2. src/math/big/int_test.go

    	{"-0x8000000000000000000", 75},
    }
    
    func TestTrailingZeroBits(t *testing.T) {
    	for i, test := range tzbTests {
    		in, _ := new(Int).SetString(test.in, 0)
    		want := test.out
    		got := in.TrailingZeroBits()
    
    		if got != want {
    			t.Errorf("#%d: got %v want %v", i, got, want)
    		}
    	}
    }
    
    func BenchmarkBitset(b *testing.B) {
    	z := new(Int)
    	z.SetBit(z, 512, 1)
    	b.ResetTimer()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 18:42:28 UTC 2024
    - 58.5K bytes
    - Viewed (0)
  3. 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