README.md (2638B)
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 # isInfinite 22 23 > Test if a value is an infinite number. 24 25 <section class="usage"> 26 27 ## Usage 28 29 ```javascript 30 var isInfinite = require( '@stdlib/assert/is-infinite' ); 31 ``` 32 33 #### isInfinite( value ) 34 35 Tests if a value is an infinite `number`. 36 37 <!-- eslint-disable no-new-wrappers --> 38 39 ```javascript 40 var Number = require( '@stdlib/number/ctor' ); 41 42 var bool = isInfinite( 1.0/0.0 ); 43 // returns true 44 45 bool = isInfinite( new Number( 1.0/0.0 ) ); 46 // returns true 47 48 bool = isInfinite( 1.0 ); 49 // returns false 50 51 bool = isInfinite( null ); 52 // returns false 53 ``` 54 55 #### isInfinite.isPrimitive( value ) 56 57 Tests if a `value` is a primitive `number` having an infinite value. 58 59 <!-- eslint-disable no-new-wrappers --> 60 61 ```javascript 62 var Number = require( '@stdlib/number/ctor' ); 63 64 var bool = isInfinite.isPrimitive( -1.0/0.0 ); 65 // returns true 66 67 bool = isInfinite.isPrimitive( new Number( -1.0/0.0 ) ); 68 // returns false 69 ``` 70 71 #### isInfinite.isObject( value ) 72 73 Tests if a `value` is a `Number` object having an infinite value. 74 75 <!-- eslint-disable no-new-wrappers --> 76 77 ```javascript 78 var Number = require( '@stdlib/number/ctor' ); 79 80 var bool = isInfinite.isObject( 1.0/0.0 ); 81 // returns false 82 83 bool = isInfinite.isObject( new Number( 1.0/0.0 ) ); 84 // returns true 85 ``` 86 87 </section> 88 89 <!-- /.usage --> 90 91 <section class="notes"> 92 93 </section> 94 95 <!-- /.notes --> 96 97 <section class="examples"> 98 99 ## Examples 100 101 <!-- eslint-disable no-new-wrappers --> 102 103 <!-- eslint no-undef: "error" --> 104 105 ```javascript 106 var Number = require( '@stdlib/number/ctor' ); 107 var isInfinite = require( '@stdlib/assert/is-infinite' ); 108 109 var bool = isInfinite( 1.0/0.0 ); 110 // returns true 111 112 bool = isInfinite( -1.0/0.0 ); 113 // returns true 114 115 bool = isInfinite( new Number( 1.0/0.0 ) ); 116 // returns true 117 118 bool = isInfinite( -5.0 ); 119 // returns false 120 121 bool = isInfinite( 0.0 ); 122 // returns false 123 124 bool = isInfinite( 5.256 ); 125 // returns false 126 127 bool = isInfinite( '1.0/0.0' ); 128 // returns false 129 130 bool = isInfinite( null ); 131 // returns false 132 ``` 133 134 </section> 135 136 <!-- /.examples --> 137 138 <section class="links"> 139 140 </section> 141 142 <!-- /.links -->