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

sumerian-math

v1.0.0

Published

Sumerian/Babylonian base-60 math: cuneiform rendering, sexagesimal notation parsing, IGI reciprocal table, and the Babylonian square root algorithm

Readme

sumerian-math 𒁹 𒌋𒌋𒐉 𒐐𒁹 𒌋

Sumerian/Babylonian base-60 mathematics in pure JavaScript — no dependencies, ESM, works in Node 18+ and every modern browser.

Extracted from SumerianMath 3D, an interactive 3D scribe workshop.

Install

npm install sumerian-math

Usage

import {
  decimalToSexagesimalDigits,
  sexagesimalDigitsToDecimal,
  decimalToCuneiform,
  decimalToSexagesimalFraction,
  parseSexagesimalNotation,
  isRegularNumber,
  computeBabylonianSquareRoot,
  BABYLONIAN_RECIPROCALS,
} from 'sumerian-math';

// Integers ↔ base-60 places
decimalToSexagesimalDigits(405798);      // [1, 52, 43, 18]
sexagesimalDigitsToDecimal([2, 15]);     // 135

// Straight to cuneiform
decimalToCuneiform(75);                  // '𒁹 𒌋𒁹𒁹𒁹𒁹𒁹'  (1,15)

// Fractions and academic notation
decimalToSexagesimalFraction(Math.SQRT2, 3).notation;  // '1 ; 24, 51, 10'
parseSexagesimalNotation('1 ; 24, 51, 10');            // 1.4142129629629...

// Which divisors terminate in base 60?
isRegularNumber(54);  // true  (54 = 2·3³, so 1/54 terminates)
isRegularNumber(7);   // false (1/7 repeats forever, even for Babylonians)

// Division the Babylonian way: multiply by the reciprocal (IGI)
const igi8 = BABYLONIAN_RECIPROCALS.find(r => r.n === 8);
igi8.notation;        // '0 ; 7, 30'  (1/8 = 7/60 + 30/3600)

// Babylonian square root of 2 (the YBC 7289 value), starting from 1.5
computeBabylonianSquareRoot(2, 1.5, 3).at(-1).sexagesimal;  // '1 ; 24, 51, 10'

API

| Export | Description | |--------|-------------| | numberToWedges(n) | Splits a digit 0–59 into tens/ones with Unicode cuneiform and ASCII output | | decimalToSexagesimalDigits(n) | Integer → base-60 digit array, highest place first | | sexagesimalDigitsToDecimal(digits) | Base-60 digit array → integer | | decimalToCuneiform(n) | Integer → cuneiform string, places separated by spaces | | formatSexagesimal(digits) | Digit array → '2, 15' notation | | decimalToSexagesimalFraction(val, precision) | Float → a ; b, c, d notation with fractional places | | parseSexagesimalNotation(str) | '1 ; 24, 51, 10' → decimal float | | isRegularNumber(n) | True for 5-smooth numbers (terminating base-60 reciprocals) | | computeBabylonianSquareRoot(S, guess, steps) | Iteration trace of xₙ₊₁ = ½(xₙ + S/xₙ) | | BABYLONIAN_RECIPROCALS | The standard reciprocal (IGI) table of regular numbers | | CUNEIFORM_GLYPHS | Unicode cuneiform signs for digits and operations |

Notation

Sexagesimal places are separated by commas, and the fractional point by a semicolon, following standard Assyriological convention:

1;24,51,10 = 1 + 24/60 + 51/60² + 10/60³ ≈ 1.41421296

License

MIT