Skip to content
This repository was archived by the owner on Jun 26, 2026. It is now read-only.

io7m-com/jnfp

Repository files navigation

jnfp

Maven Central Maven Central (snapshot) Codecov Java Version

com.io7m.jnfp

JVM Platform Status
OpenJDK (Temurin) Current Linux Build (OpenJDK (Temurin) Current, Linux)
OpenJDK (Temurin) LTS Linux Build (OpenJDK (Temurin) LTS, Linux)
OpenJDK (Temurin) Current Windows Build (OpenJDK (Temurin) Current, Windows)
OpenJDK (Temurin) LTS Windows Build (OpenJDK (Temurin) LTS, Windows)

Repository Relocation

Development of this project has moved to an open-source but not open-contribution model.

Source code and commits will remain publicly available perpetually, but issues and/or pull requests will be rejected and/or ignored. Additionally, this project will now only be available via a read-only mirror at:

https://codeberg.org/io7m-com/jnfp

jnfp

Java functions to convert between floating point and normalized fixed point values.

Features

  • Conversion between unsigned normalized fixed-point numbers and floating point numbers.
  • Conversion between signed normalized fixed-point numbers and floating point numbers.
  • High coverage test suite.
  • OSGi-ready
  • JPMS-ready
  • ISC license.

Usage

Convert a floating point value to its 32-bit unsigned normalized fixed point representation:

var r = NFPUnsignedFloatLong.toUnsignedNormalized(0.25, 32);

Convert a 32-bit unsigned normalized fixed point value to its floating point representation:

var s = NFPUnsignedFloatLong.fromUnsignedNormalized(r, 32);

Classes exist for signed, unsigned, int, long, float, and double specializations.

About

Java normalized fixed-point

Topics

Resources

License

Stars

0 stars

Watchers

1 watching

Forks

Contributors