- Sort Score
- Result 10 results
- Languages All
Results 1 - 2 of 2 for basicSqr (0.1 sec)
-
src/math/big/nat.go
addAt(z, t, i+k) } putNat(tp) } return z.norm() } // basicSqr sets z = x*x and is asymptotically faster than basicMul // by about a factor of 2, but slower for small arguments due to overhead. // Requirements: len(x) > 0, len(z) == 2*len(x) // The (non-normalized) result is placed in z. func basicSqr(z, x nat) { n := len(x) tp := getNat(2 * n) t := *tp // temporary variable to hold the products
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon May 13 21:31:58 UTC 2024 - 31.7K bytes - Viewed (0) -
src/math/big/nat_test.go
} } } } func testSqr(t *testing.T, x nat) { got := make(nat, 2*len(x)) want := make(nat, 2*len(x)) got = got.sqr(x) want = want.mul(x, x) if got.cmp(want) != 0 { t.Errorf("basicSqr(%v), got %v, want %v", x, got, want) } } func TestSqr(t *testing.T) { for _, a := range prodNN { if a.x != nil { testSqr(t, a.x) } if a.y != nil { testSqr(t, a.y) }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Jan 09 15:29:36 UTC 2024 - 26.2K bytes - Viewed (0)