npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@mark1russell7/interval

v0.1.1

Published

Float error bounds: outward-rounded intervals, midpoint-radius balls, nextUp and nextDown, and the error-free transforms of a sum and a product.

Readme

@mark1russell7/interval

This package is the home of the float error bounds of algebra (roadmap item A21). It has intervals with outward rounding, balls with a midpoint and a radius, and the float steps and error terms that they use. Each operation contains the exact result of the operation on each point of its inputs.

The package has no runtime dependencies. It is in the layer numbers, so each layer above it can use it. Later bounds of arbitrary precision also go here.

The functions

| Name | Result | Error | | --- | --- | --- | | nextUp(x), nextDown(x) | The next float above or below x | Exact | | sumError(a, b, s) | The error e of s = fl(a + b), with a + b = s + e (TwoSum) | Exact, or NaN when s is not finite | | productError(a, b, p) | The error e of p = fl(a * b), with a * b = p + e (TwoProduct) | Exact, or NaN near overflow and underflow | | quotientIsExact(a, b, q) | true when q is the exact quotient a / b | Exact | | addUp, mulUp, divUp, subDown | A sum, product or quotient of nonnegative floats rounded upward, and a difference rounded downward | One float step at most | | floatRoot(r, k) | The float root of index k, with an odd root of a negative value | The square root is correctly rounded | | interval | The intervals: add, sub, mul, div, neg, pow, root, min, max, lt, le, eq | Outward, one float step on each end at most | | ball | The balls: ball, add, sub, mul, div, neg, pow, root, min, max, lt, le, eq, toInterval, fromInterval | A finite radius is a claim |

An interval is readonly [low, high], or null for the empty interval. An infinite end is no bound on its side.

A ball is { mid, rad }. A finite radius is a claim: the exact result is at most rad from mid. The radius Infinity makes no claim. The radius functions sumRadius, productRadius, quotientRadius, extremeRadius and rootRadius make no object. An evaluator that keeps the midpoint and the radius in two numbers uses them.

import { ball, interval } from "@mark1russell7/interval";

interval.add([0.1, 0.1], [0.2, 0.2]); // [0.3, 0.3000000000000001]: one step each side of the float sum
ball.mul(ball.ball(3, 0.5), ball.ball(2)); // { mid: 6, rad: 1 }

The law tests

  • src/enclosure.test.ts has a fast-check property for each operation. The property compares the result with the exact rationals of @mark1russell7/rational at the ends and the midpoint of each input.
  • Planted operations with a bound one float step too narrow fail the same properties.
  • src/width.test.ts is the width gate. A fixed family of inputs from @mark1russell7/rigor-generators goes through 6 chains of operations, for intervals and for balls.
  • The gate keeps the median and the largest width of each chain, in float steps, in test/width-record.json.
  • A larger width fails the gate. A smaller width also fails, until the record changes with it. So the gate holds each gain.
  • Planted operations with a bound one step wider fail the gate.
  • To write a new record, set INTERVAL_WIDTH_RECORD=update and start the width test. Commit the record with the change that moves a width.