Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

robust-sum

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

robust-sum

Evaluates the sum of two nonoverlapping increasing sequences of floats

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
93K
decreased by-7.1%
Maintainers
1
Weekly downloads
 
Created
Source

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". 1997

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

Keywords

FAQs

Package last updated on 28 Apr 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc