simple-squiggle

A restricted subset of Squiggle
Log | Files | Refs | README

isNaN.md (1362B)


      1 <!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
      2 
      3 # Function isNaN
      4 
      5 Test whether a value is NaN (not a number).
      6 The function supports types `number`, `BigNumber`, `Fraction`, `Unit` and `Complex`.
      7 
      8 The function is evaluated element-wise in case of Array or Matrix input.
      9 
     10 
     11 ## Syntax
     12 
     13 ```js
     14 math.isNaN(x)
     15 ```
     16 
     17 ### Parameters
     18 
     19 Parameter | Type | Description
     20 --------- | ---- | -----------
     21 `x` | number &#124; BigNumber &#124; Fraction &#124; Unit &#124; Array &#124; Matrix | Value to be tested
     22 
     23 ### Returns
     24 
     25 Type | Description
     26 ---- | -----------
     27 boolean | Returns true when `x` is NaN. Throws an error in case of an unknown data type.
     28 
     29 
     30 ### Throws
     31 
     32 Type | Description
     33 ---- | -----------
     34 
     35 
     36 ## Examples
     37 
     38 ```js
     39 math.isNaN(3)                     // returns false
     40 math.isNaN(NaN)                   // returns true
     41 math.isNaN(0)                     // returns false
     42 math.isNaN(math.bignumber(NaN))   // returns true
     43 math.isNaN(math.bignumber(0))     // returns false
     44 math.isNaN(math.fraction(-2, 5))  // returns false
     45 math.isNaN('-2')                  // returns false
     46 math.isNaN([2, 0, -3, NaN]')      // returns [false, false, false, true]
     47 ```
     48 
     49 
     50 ## See also
     51 
     52 [isNumeric](isNumeric.md),
     53 [isNegative](isNegative.md),
     54 [isPositive](isPositive.md),
     55 [isZero](isZero.md),
     56 [isInteger](isInteger.md)