Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for Sub32F (0.26 sec)

  1. src/math/bits/example_math_test.go

    func ExampleSub32() {
    	// First number is 33<<32 + 23
    	n1 := []uint32{33, 23}
    	// Second number is 21<<32 + 12
    	n2 := []uint32{21, 12}
    	// Sub them together without producing carry.
    	d1, carry := bits.Sub32(n1[1], n2[1], 0)
    	d0, _ := bits.Sub32(n1[0], n2[0], carry)
    	nsum := []uint32{d0, d1}
    	fmt.Printf("%v - %v = %v (carry bit was %v)\n", n1, n2, nsum, carry)
    
    	// First number is 3<<32 + 2147483647
    	n1 = []uint32{3, 0x7fffffff}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Nov 11 21:27:05 UTC 2021
    - 6.3K bytes
    - Viewed (0)
Back to top