Skip to content

Commit 30649fa

Browse files
committed
Noncombining.
1 parent ed9a77f commit 30649fa

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

ext/stats/kahan.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ package stats
55
type kahan struct{ hi, lo float64 }
66

77
func (k *kahan) add(x float64) {
8-
y := k.lo + x
9-
t := k.hi + y
10-
k.lo = y - (t - k.hi)
8+
y := float64(k.lo + x)
9+
t := float64(k.hi + y)
10+
k.lo = y - float64(t-k.hi)
1111
k.hi = t
1212
}
1313

1414
func (k *kahan) sub(x float64) {
15-
y := k.lo - x
16-
t := k.hi + y
17-
k.lo = y - (t - k.hi)
15+
y := float64(k.lo - x)
16+
t := float64(k.hi + y)
17+
k.lo = y - float64(t-k.hi)
1818
k.hi = t
1919
}

0 commit comments

Comments
 (0)