Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mikolalysenko/robust-sum
Exactly computes the sum of a pair of non-overlapping sequences of floats.
https://github.com/mikolalysenko/robust-sum
Last synced: about 2 months ago
JSON representation
Exactly computes the sum of a pair of non-overlapping sequences of floats.
- Host: GitHub
- URL: https://github.com/mikolalysenko/robust-sum
- Owner: mikolalysenko
- License: mit
- Created: 2013-09-18T17:09:49.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2014-05-28T17:18:10.000Z (over 10 years ago)
- Last Synced: 2024-10-20T14:28:21.766Z (2 months ago)
- Language: JavaScript
- Size: 176 KB
- Stars: 4
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
robust-sum
==========
Computes the sum of two increasing non-overlapping sequences of floats as an increasing non-overlapping sequence. This can be used to perform exact arithmetic calculations on floating point values.For more information, see:
* Jonathan Richard Shewchuk, ["Adaptive precision floating-point arithmetic and fast robust geometric predicates"](http://www.cs.cmu.edu/afs/cs/project/quake/public/papers/robust-arithmetic.ps). 1997
[![testling badge](https://ci.testling.com/mikolalysenko/robust-sum.png)](https://ci.testling.com/mikolalysenko/robust-sum)
[![build status](https://secure.travis-ci.org/mikolalysenko/robust-sum.png)](http://travis-ci.org/mikolalysenko/robust-sum)
## Install
npm install robust-sum
## Example
```javascript
var robustSum = require("robust-sum")var seq = robustSum([1, 64], [1e-64, 1e64])
console.log("result = ", seq)
```## API
### `require("robust-sum")(a, b)`
Computes the sum of two non-overlapping increasing sequences of floats exactly as a non-overlapping increasing sequence of floats.* `a` is a non-overlapping sequence of floats that is increasing in magnitude
* `b` is a non-overlapping sequence of floats that is increasing magnitude**Returns** A non-overlapping increasing sequence that encodes the result of `a+b`
## Credits
Based on JRS' robust geometric predicates for floating point arithmetic.Implementation (c) 2013 Mikola Lysenko. MIT License