simple-squiggle

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

larger.md (1482B)


      1 <!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
      2 
      3 # Function larger
      4 
      5 Test whether value x is larger than y.
      6 
      7 The function returns true when x is larger than y and the relative
      8 difference between x and y is larger than the configured epsilon. The
      9 function cannot be used to compare values smaller than approximately 2.22e-16.
     10 
     11 For matrices, the function is evaluated element wise.
     12 Strings are compared by their numerical value.
     13 
     14 
     15 ## Syntax
     16 
     17 ```js
     18 math.larger(x, y)
     19 ```
     20 
     21 ### Parameters
     22 
     23 Parameter | Type | Description
     24 --------- | ---- | -----------
     25 `x` | number &#124; BigNumber &#124; Fraction &#124; boolean &#124; Unit &#124; string &#124; Array &#124; Matrix | First value to compare
     26 `y` | number &#124; BigNumber &#124; Fraction &#124; boolean &#124; Unit &#124; string &#124; Array &#124; Matrix | Second value to compare
     27 
     28 ### Returns
     29 
     30 Type | Description
     31 ---- | -----------
     32 boolean &#124; Array &#124; Matrix | Returns true when the x is larger than y, else returns false
     33 
     34 
     35 ### Throws
     36 
     37 Type | Description
     38 ---- | -----------
     39 
     40 
     41 ## Examples
     42 
     43 ```js
     44 math.larger(2, 3)             // returns false
     45 math.larger(5, 2 + 2)         // returns true
     46 
     47 const a = math.unit('5 cm')
     48 const b = math.unit('2 inch')
     49 math.larger(a, b)             // returns false
     50 ```
     51 
     52 
     53 ## See also
     54 
     55 [equal](equal.md),
     56 [unequal](unequal.md),
     57 [smaller](smaller.md),
     58 [smallerEq](smallerEq.md),
     59 [largerEq](largerEq.md),
     60 [compare](compare.md)