mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
delete TODO now that compiler is better at %
adjust an inconsistency in reflect/type.go's package comment R=rsc http://go/go-review/1026029
This commit is contained in:
parent
7837dbfcb8
commit
ceb6031ecd
2 changed files with 2 additions and 20 deletions
|
|
@ -66,7 +66,7 @@ type AminoAcid struct {
|
|||
var lastrandom uint32 = 42
|
||||
|
||||
// Random number between 0.0 and 1.0
|
||||
func Zmyrandom() float {
|
||||
func myrandom() float {
|
||||
const (
|
||||
IM = 139968;
|
||||
IA = 3877;
|
||||
|
|
@ -77,24 +77,6 @@ func Zmyrandom() float {
|
|||
return float(int32(lastrandom)) / IM;
|
||||
}
|
||||
|
||||
// TODO: delete this when compiler does the reduction for us
|
||||
func
|
||||
myrandom() float
|
||||
{
|
||||
const (
|
||||
IM = 139968;
|
||||
IA = 3877;
|
||||
IC = 29573;
|
||||
S = 46;
|
||||
IM1 = ((1<<S) + IM) / IM;
|
||||
)
|
||||
|
||||
n := (lastrandom * IA + IC);
|
||||
q := uint32((uint64(n) * IM1) >> S);
|
||||
lastrandom = n - q*IM;
|
||||
return float(int32(lastrandom)) / IM;
|
||||
}
|
||||
|
||||
func AccumulateProbabilities(genelist []AminoAcid) {
|
||||
for i := 1; i < len(genelist); i++ {
|
||||
genelist[i].p += genelist[i-1].p;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue