Correctness fixes from #58. Published to npm as fp-conv-cli@1.1.0.
Fixed
encode()now rounds instead of truncating for zero-mantissa formats (previously up to 2x error)- unsigned formats no longer emit a sign bit for
-Infinity, which produced an encoding that could not be decoded - NaN and Infinity no longer share an encoding when
mantissaBits === 0 - directed rounding no longer flushes tiny nonzero values to zero, which violated IEEE 754
- unknown rounding modes are now rejected consistently, rather than only for inexact values
Changed
- nonzero fixed-point results now report
isNormal: true, matchingclassify() - invalid rounding modes that were silently accepted for exact, zero and special values now throw
Full changelog: cli-v1.0.2...cli-v1.1.0