Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(836)

Delta Between Two Patch Sets: src/pkg/math/big/nat_test.go

Issue 90080043: code review 90080043: math/big: fix Int.Exp (Closed)
Left Patch Set: diff -r c313673339c4 https://code.google.com/p/go/ Created 9 years, 11 months ago
Right Patch Set: diff -r c313673339c4 https://code.google.com/p/go/ Created 9 years, 11 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « src/pkg/math/big/nat.go ('k') | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 // Copyright 2009 The Go Authors. All rights reserved. 1 // Copyright 2009 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style 2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file. 3 // license that can be found in the LICENSE file.
4 4
5 package big 5 package big
6 6
7 import ( 7 import (
8 "io" 8 "io"
9 "runtime" 9 "runtime"
10 "strings" 10 "strings"
(...skipping 696 matching lines...) Expand 10 before | Expand all | Expand 10 after
707 t.Errorf("got 0x%s.trailingZeroBits() = %d; want %d", y. string(lowercaseDigits[0:16]), n, i) 707 t.Errorf("got 0x%s.trailingZeroBits() = %d; want %d", y. string(lowercaseDigits[0:16]), n, i)
708 } 708 }
709 y = y.shl(y, 1) 709 y = y.shl(y, 1)
710 } 710 }
711 } 711 }
712 712
713 var expNNTests = []struct { 713 var expNNTests = []struct {
714 x, y, m string 714 x, y, m string
715 out string 715 out string
716 }{ 716 }{
717 {"0", "0", "0", "1"},
717 {"0", "0", "1", "0"}, 718 {"0", "0", "1", "0"},
718 {"1", "1", "1", "0"}, 719 {"1", "1", "1", "0"},
719 {"2", "1", "1", "0"}, 720 {"2", "1", "1", "0"},
720 {"2", "2", "1", "0"}, 721 {"2", "2", "1", "0"},
721 {"10", "100000000000", "1", "0"}, 722 {"10", "100000000000", "1", "0"},
722 {"0x8000000000000000", "2", "", "0x40000000000000000000000000000000"}, 723 {"0x8000000000000000", "2", "", "0x40000000000000000000000000000000"},
723 {"0x8000000000000000", "2", "6719", "4944"}, 724 {"0x8000000000000000", "2", "6719", "4944"},
724 {"0x8000000000000000", "3", "6719", "5447"}, 725 {"0x8000000000000000", "3", "6719", "5447"},
725 {"0x8000000000000000", "1000", "6719", "1603"}, 726 {"0x8000000000000000", "1000", "6719", "1603"},
726 {"0x8000000000000000", "1000000", "6719", "3199"}, 727 {"0x8000000000000000", "1000000", "6719", "3199"},
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
761 func BenchmarkExp3Power0x10(b *testing.B) { ExpHelper(b, 3, 0x10) } 762 func BenchmarkExp3Power0x10(b *testing.B) { ExpHelper(b, 3, 0x10) }
762 func BenchmarkExp3Power0x40(b *testing.B) { ExpHelper(b, 3, 0x40) } 763 func BenchmarkExp3Power0x40(b *testing.B) { ExpHelper(b, 3, 0x40) }
763 func BenchmarkExp3Power0x100(b *testing.B) { ExpHelper(b, 3, 0x100) } 764 func BenchmarkExp3Power0x100(b *testing.B) { ExpHelper(b, 3, 0x100) }
764 func BenchmarkExp3Power0x400(b *testing.B) { ExpHelper(b, 3, 0x400) } 765 func BenchmarkExp3Power0x400(b *testing.B) { ExpHelper(b, 3, 0x400) }
765 func BenchmarkExp3Power0x1000(b *testing.B) { ExpHelper(b, 3, 0x1000) } 766 func BenchmarkExp3Power0x1000(b *testing.B) { ExpHelper(b, 3, 0x1000) }
766 func BenchmarkExp3Power0x4000(b *testing.B) { ExpHelper(b, 3, 0x4000) } 767 func BenchmarkExp3Power0x4000(b *testing.B) { ExpHelper(b, 3, 0x4000) }
767 func BenchmarkExp3Power0x10000(b *testing.B) { ExpHelper(b, 3, 0x10000) } 768 func BenchmarkExp3Power0x10000(b *testing.B) { ExpHelper(b, 3, 0x10000) }
768 func BenchmarkExp3Power0x40000(b *testing.B) { ExpHelper(b, 3, 0x40000) } 769 func BenchmarkExp3Power0x40000(b *testing.B) { ExpHelper(b, 3, 0x40000) }
769 func BenchmarkExp3Power0x100000(b *testing.B) { ExpHelper(b, 3, 0x100000) } 770 func BenchmarkExp3Power0x100000(b *testing.B) { ExpHelper(b, 3, 0x100000) }
770 func BenchmarkExp3Power0x400000(b *testing.B) { ExpHelper(b, 3, 0x400000) } 771 func BenchmarkExp3Power0x400000(b *testing.B) { ExpHelper(b, 3, 0x400000) }
LEFTRIGHT

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b