## Constructor

#### new Accumulator(yopt)

Accurate summation of many numbers.

##### Parameters:

Name | Type | Attributes | Default | Description |
---|---|---|---|---|

`y` |
number | Accumulator |
<optional> |
0 | set sum = y. |

### Methods

#### Add(yopt)

Add a number to the accumulator.

##### Parameters:

Name | Type | Attributes | Default | Description |
---|---|---|---|---|

`y` |
number |
<optional> |
0 | set sum += y. |

#### Negate()

Set sum = −sum.

#### Set(yopt)

Set the accumulator to a number.

##### Parameters:

Name | Type | Attributes | Default | Description |
---|---|---|---|---|

`y` |
number | Accumulator |
<optional> |
0 | set sum = y. |

#### Sum(yopt)

Return the result of adding a number to sum (but don't change sum).

##### Parameters:

Name | Type | Attributes | Default | Description |
---|---|---|---|---|

`y` |
number |
<optional> |
0 | the number to be added to the sum. |

##### Returns:

sum + y.