0.0.7 • Published 9 years ago

math-interval-js v0.0.7

Weekly downloads
1
License
MIT
Repository
github
Last release
9 years ago

Math Interval JS

Join the chat at https://gitter.im/vluzrmos/interval-js

npm version Build Status

Check if a given number match with a math interval.

Install

You just download the source zip.

Or if you want:

NPM:

npm install math-interval-js.

Bower:

bower install math-interval-js.

Composer:

composer require vluzrmos/math-interval-js.

Usage

Simple:

Interval.test(1, "[1,2]");
// true

Interval.test(3, "[1,2]");
// false

Set of numbers:

Interval.test(2, "{1,3,5,7}");
// false

Interval.test(3, "{1,3,5,7}");
// true

Infinity:

Interval.test(-2, "[1, Inf)");
// false

Interval.test(400, "[1, Inf)");
// true
Interval.test(-2, "(-Inf, Inf)");
// true

Interval.test(1000, "(-Inf, Inf)");
// true

Simple excluded:

Interval.test(-2, "(-2, 2)");
// false

Interval.test(2, "(-2, 2)");
// false

Interval.test(0, "(-2, 2)");
// true

Interval.test(1, "(-2, 2)");
// true

Importing

NodeJS:

var Interval = require('math-interval-js');

Html:

<script src="/path/to/that/package/src/interval.js"></script>
0.0.7

9 years ago

0.0.6

9 years ago

0.0.5

9 years ago

0.0.4

9 years ago

0.0.3

9 years ago

0.0.2

9 years ago

0.0.1

9 years ago

0.0.0

9 years ago