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

goldenfloat

v1.1.0

Published

φ-optimized 16-bit floating point format for ML (GF16)

Downloads

113

Readme

GoldenFloat — φ-optimized 16-bit floating point format

npm Node License

GF16: [sign:1][exp:6][mant:9] — φ-distance 0.049 (best among 16-bit formats)

Installation

npm install goldenfloat

Note: You need the libgoldenfloat shared library. Build from source:

git clone https://github.com/gHashTag/zig-golden-float
cd zig-golden-float
zig build shared
export GOLDENFLOAT_LIB_PATH=$(pwd)/zig-out/lib

Quick Start

import { GF16 } from 'goldenfloat';

// Basic arithmetic
const a = new GF16(3.14);
const b = new GF16(2.71);
const c = a.add(b);
console.log(`3.14 + 2.71 = ${c.toFloat()}`);  // 5.85

// φ-optimized quantization
const weight = 2.71828;
const quantized = GF16.phiQuantize(weight);
console.log(`Original: ${weight}`);
console.log(`Quantized: ${quantized.toFloat()}`);

// Check properties
console.log(`Is zero? ${quantized.isZero()}`);
console.log(`Is negative? ${quantized.isNegative()}`);

API

Class: GF16

| Method | Description | |--------|-------------| | new GF16(value: number) | Create from float | | GF16.fromBits(bits: number) | Create from raw bits | | GF16.phiQuantize(value: number) | φ-optimized quantization | | .toFloat() | Convert to number | | .add(other: GF16) | Addition | | .sub(other: GF16) | Subtraction | | .mul(other: GF16) | Multiplication | | .div(other: GF16) | Division | | .neg() | Negation | | .abs() | Absolute value | | .isNaN() | Check if NaN | | .isInf() | Check if infinite | | .isZero() | Check if zero | | .isNegative() | Check if negative |

Low-level Functions

import {
  gf16_from_f32,
  gf16_to_f32,
  gf16_add,
  gf16_phi_quantize,
  GF16_ZERO,
  GF16_ONE,
  PHI,
  TRINITY,
} from 'goldenfloat';

// Direct bit manipulation
const bits = gf16_from_f32(3.14);
const value = gf16_to_f32(bits);

Constants

import {
  GF16_ZERO,  // 0x0000 (zero)
  GF16_ONE,   // 0x3C00 (one)
  GF16_PINF,  // 0x7E00 (+infinity)
  PHI,        // 1.6180339887498949 (golden ratio)
  TRINITY,    // 3.0 (φ² + 1/φ²)
} from 'goldenfloat';

Express.js Integration

import express from 'express';
import { GF16, gf16_from_f32, gf16_to_f32 } from 'goldenfloat';

const app = express();

app.post('/compute', (req, res) => {
  const { a, b } = req.body;
  const gfA = gf16_from_f32(a);
  const gfB = gf16_from_f32(b);
  const sum = gf16_add(gfA, gfB);
  res.json({ sum: gf16_to_f32(sum) });
});

app.listen(3000);

License

MIT — See LICENSE

Links