Java normalized fixed-point
- Java 70.2%
- StringTemplate 29.7%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| .forgejo | ||
| com.io7m.jnfp.core | ||
| com.io7m.jnfp.tests | ||
| src/site/resources | ||
| .gitignore | ||
| .gitmodules | ||
| doc7m-books.json | ||
| pom.xml | ||
| README-CHANGES.xml | ||
| README-LICENSE.txt | ||
| README.in | ||
| README.md | ||
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.
