philips_supernote-obsidian-.../node_modules/robust-sum
Brandon Philips 2518e666d2 node_modules: initial import
Since there is no native code I am just checking all of the dependencies
in to simplify life and avoid a hard dependency on npm working on any
given day.
2024-04-05 23:08:52 -07:00
..
test node_modules: initial import 2024-04-05 23:08:52 -07:00
.npmignore node_modules: initial import 2024-04-05 23:08:52 -07:00
LICENSE node_modules: initial import 2024-04-05 23:08:52 -07:00
package.json node_modules: initial import 2024-04-05 23:08:52 -07:00
README.md node_modules: initial import 2024-04-05 23:08:52 -07:00
robust-sum.js node_modules: initial import 2024-04-05 23:08:52 -07:00

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:

Install

	npm install robust-sum

Example

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