Skip to content

Commit 218ad7f

Browse files
committed
Fix two-double addition for Time.
Somehow, the implementation was not the same as that referenced.
1 parent 46b249f commit 218ad7f

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

‎astropy/time/utils.py‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,10 @@ def two_sum(a, b):
124124
Approximate sum of a + b and the exact floating point error
125125
"""
126126
x = a + b
127-
eb = x - a
128-
eb = b - eb
129-
ea = x - b
130-
ea = a - ea
127+
eb = x - a # bvirtual in Shewchuk
128+
ea = x - eb # avirtual in Shewchuk
129+
eb = b - eb # broundoff in Shewchuk
130+
ea = a - ea # aroundoff in Shewchuk
131131
return x, ea + eb
132132

133133

0 commit comments

Comments
 (0)