# isProbability
> Test if a numeric value is a probability.
## Usage
```javascript
var isProbability = require( '@stdlib/math/base/assert/is-probability' );
```
#### isProbability( x )
Tests if a `numeric` value is a probability.
```javascript
var bool = isProbability( 0.5 );
// returns true
bool = isProbability( 3.14 );
// returns false
bool = isProbability( NaN );
// returns false
```
## Examples
```javascript
var randu = require( '@stdlib/random/base/randu' );
var isProbability = require( '@stdlib/math/base/assert/is-probability' );
var bool;
var x;
var i;
for ( i = 0; i < 100; i++ ) {
x = ( randu()*2.0 ) - 1.0;
bool = isProbability( x );
console.log( '%d is %s', x, ( bool ) ? 'a probability' : 'not a probability' );
}
```