UNPKG

node-red-contrib-tak-registration

Version:

A Node-RED node to register to TAK and to help wrap files as datapackages to send to TAK

13 lines (12 loc) 422 B
import DoubleBits from './DoubleBits' export default class IntervalSize { static isZeroWidth(min, max) { const width = max - min if (width === 0.0) return true const maxAbs = Math.max(Math.abs(min), Math.abs(max)) const scaledInterval = width / maxAbs const level = DoubleBits.exponent(scaledInterval) return level <= IntervalSize.MIN_BINARY_EXPONENT } } IntervalSize.MIN_BINARY_EXPONENT = -50