Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mikolalysenko/test-float-overlap
Tests if two floating point numbers overlap
https://github.com/mikolalysenko/test-float-overlap
Last synced: 7 days ago
JSON representation
Tests if two floating point numbers overlap
- Host: GitHub
- URL: https://github.com/mikolalysenko/test-float-overlap
- Owner: mikolalysenko
- License: mit
- Created: 2014-04-28T17:36:48.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-05-01T13:42:35.000Z (over 10 years ago)
- Last Synced: 2024-12-16T22:35:46.919Z (10 days ago)
- Language: JavaScript
- Size: 137 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
test-float-overlap
==================
Test if the significands of two floating point numbers overlap.# Example
```javascript
var testOverlap = require("test-float-overlap")console.log(testOverlap(0.5, 1.0), testOverlap(1.5, 1.0))
```Output:
```javascript
false true
```# Install
```
npm install test-float-overlap
```# API
### `require("test-float-overlap")(a, b)`
Test if a pair of floating point numbers' significands overlap.* `a` and `b` are both double precision IEEE754 numbers
**Returns** `true` if the binary representations of the significands of the numbers of overlap, `false` otherwise
# Credits
(c) 2014 Mikola Lysenko. MIT License