time-to-botec

Benchmark sampling in different programming languages
Log | Files | Refs | README

README.md (3148B)


      1 <!--
      2 
      3 @license Apache-2.0
      4 
      5 Copyright (c) 2018 The Stdlib Authors.
      6 
      7 Licensed under the Apache License, Version 2.0 (the "License");
      8 you may not use this file except in compliance with the License.
      9 You may obtain a copy of the License at
     10 
     11    http://www.apache.org/licenses/LICENSE-2.0
     12 
     13 Unless required by applicable law or agreed to in writing, software
     14 distributed under the License is distributed on an "AS IS" BASIS,
     15 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     16 See the License for the specific language governing permissions and
     17 limitations under the License.
     18 
     19 -->
     20 
     21 # isNegativeIntegerArray
     22 
     23 > Test if a value is an array-like object containing only negative integers.
     24 
     25 <section class="usage">
     26 
     27 ## Usage
     28 
     29 ```javascript
     30 var isNegativeIntegerArray = require( '@stdlib/assert/is-negative-integer-array' );
     31 ```
     32 
     33 #### isNegativeIntegerArray( value )
     34 
     35 Tests if a `value` is an array-like object containing **only** negative `integer` values.
     36 
     37 <!-- eslint-disable no-new-wrappers -->
     38 
     39 ```javascript
     40 var Number = require( '@stdlib/number/ctor' );
     41 
     42 var bool = isNegativeIntegerArray( [ -3, new Number(-3) ] );
     43 // returns true
     44 
     45 bool = isNegativeIntegerArray( [ -3, '3.0' ] );
     46 // returns false
     47 ```
     48 
     49 #### isNegativeIntegerArray.primitives( value )
     50 
     51 Tests if a `value` is an array-like object containing **only** negative primitive `integer` values.
     52 
     53 <!-- eslint-disable no-new-wrappers -->
     54 
     55 ```javascript
     56 var Number = require( '@stdlib/number/ctor' );
     57 
     58 var bool = isNegativeIntegerArray.primitives( [ -1.0, -10.0 ] );
     59 // returns true
     60 
     61 bool = isNegativeIntegerArray.primitives( [ -1.0, 0.0, -10.0 ] );
     62 // returns false
     63 
     64 bool = isNegativeIntegerArray.primitives( [ -3.0, new Number(-1.0) ] );
     65 // returns false
     66 ```
     67 
     68 #### isNegativeIntegerArray.objects( value )
     69 
     70 Tests if a `value` is an array-like object containing **only** `Number` objects holding negative `integer` values.
     71 
     72 <!-- eslint-disable no-new-wrappers, max-len -->
     73 
     74 ```javascript
     75 var Number = require( '@stdlib/number/ctor' );
     76 
     77 var bool = isNegativeIntegerArray.objects( [ new Number(-1.0), new Number(-10.0) ] );
     78 // returns true
     79 
     80 bool = isNegativeIntegerArray.objects( [ -1.0, 0.0, -10.0 ] );
     81 // returns false
     82 
     83 bool = isNegativeIntegerArray.objects( [ -3.0, new Number(-1.0) ] );
     84 // returns false
     85 ```
     86 
     87 </section>
     88 
     89 <!-- /.usage -->
     90 
     91 <section class="examples">
     92 
     93 ## Examples
     94 
     95 <!-- eslint-disable no-new-wrappers -->
     96 
     97 <!-- eslint no-undef: "error" -->
     98 
     99 ```javascript
    100 var Number = require( '@stdlib/number/ctor' );
    101 var isNegativeIntegerArray = require( '@stdlib/assert/is-negative-integer-array' );
    102 
    103 var bool = isNegativeIntegerArray( [ -5, -2, -3 ] );
    104 // returns true
    105 
    106 bool = isNegativeIntegerArray( [ -4, -3, -2, -1 ] );
    107 // returns true
    108 
    109 bool = isNegativeIntegerArray( [ -1, new Number( -6 ), -3 ] );
    110 // returns true
    111 
    112 bool = isNegativeIntegerArray( [ -3, -2, -1, 0 ] );
    113 // returns false
    114 
    115 bool = isNegativeIntegerArray( [ -1, 'abc', -3 ] );
    116 // returns false
    117 
    118 bool = isNegativeIntegerArray( [ -2.3, -1, -3 ] );
    119 // returns false
    120 
    121 bool = isNegativeIntegerArray( [] );
    122 // returns false
    123 ```
    124 
    125 </section>
    126 
    127 <!-- /.examples -->
    128 
    129 <section class="links">
    130 
    131 </section>
    132 
    133 <!-- /.links -->