Handbook
Glossary
sum-exact ( partials -- n )
Vocabulary
math
.
extras
.
private
Inputs
partials
an
object
Outputs
n
an
object
Definition
USING:
kernel
math
sequences
;
IN:
math.extras.private
::
sum-exact
( partials -- n )
partials
[
0.0
]
[
[
0.0 0.0
]
dip
[
nip
partial+
dup
0.0
=
not
]
find-last
drop
:>
( lo n ) n
[
0
>
]
[
f
]
if*
[
n 1
-
partials
nth
[
0.0
<
lo 0.0
<
and
]
[
0.0
>
lo 0.0
>
and
]
bi
or
[
lo 2.0
*
:>
y
dup
y
+
:>
x x
over
-
:>
yr y yr
=
[
drop
x
]
when
]
when
]
when
]
if-empty
;