Skip to content

sw23/fp-conv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

86 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Floating Point Conversion Calculator

Interactive tool for converting and visualizing floating-point numbers across standard and custom formats. Convert between FP32, FP16, BF16, TF32, FP8, etc. while inspecting binary representations and precision loss.

Live URL: https://sw23.github.io/fp-conv/

Features

  • Format presets: FP64, FP32, FP16, BF16, TF32, OCP FP4/FP6/FP8
  • Integer formats: INT32, UINT32, INT16, UINT16, INT8, UINT8, INT4, UINT4
  • OCP format support: Full support for Open Compute Project microscaling formats
  • Custom formats: Define any bit layout (0–15 exponent bits, 0–112 mantissa bits)
  • Interactive editing: Toggle individual bits and see decimal/hex updates
  • Precision analysis: Calculate absolute and relative error between formats
  • Special values: Explore zero, infinity, NaN, subnormals, and boundary cases
  • Rounding modes: Implements IEEE 754 rounding modes (ties to even, ties away from zero, toward zero, toward +inf, and toward −inf)
  • Fixed-point mode: Set exponent bits to 0 for fractional representations
  • Mobile-friendly: Works on screens of all sizes
  • WebMCP API: AI agents can perform conversions via WebMCP

Supported Formats

The following standard formats are supported, in addition to any custom format you define (up to 15 exponent bits and 112 mantissa bits). Interactive pages have been created to help explain and visualize each standard format:

MCP Server

The fp-conv-mcp npm package provides a local Model Context Protocol server, giving agents direct local access to floating point format conversions.

Example client configuration (VS Code, .vscode/mcp.json):

{
  "servers": {
    "fp-conv": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "fp-conv-mcp"]
    }
  }
}

See the package README for full usage, per-client setup, and debugging instructions.

License

MIT © 2026 Spencer Williams. See LICENSE.