JSPM

bisect

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

Floating point binary search

Package Exports

  • bisect

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 (bisect) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

bisect

Floating point bisection method for JavaScript

Usage

Install using npm:

npm install bisect

And use as follows:

var bisect = require("bisect")

//Find cube root of 5 to 8 decimal places
console.log(bisect(
  function(x) {
    return x * x * x - 5 > 0
  },
  -10, 10, 1e-8))

require("bisect")(predicate, lo, hi[, tolerance])

Supposing that predicate is monotone over the interval [lo,hi), finds the first occurence of where predicate is true up to a resolution of tolerance.

Credits

(c) 2013 Mikola Lysenko. MIT License