JSPM

robust-sum

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 108489
  • Score
    100M100P100Q164667F
  • License MIT

Evaluates the sum of two nonoverlapping increasing sequences of floats

Package Exports

  • robust-sum

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (robust-sum) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

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:

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