simple-squiggle

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

fraction.md (1009B)


      1 <!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
      2 
      3 # Function fraction
      4 
      5 Create a fraction convert a value to a fraction.
      6 
      7 
      8 ## Syntax
      9 
     10 ```js
     11 math.fraction(numerator, denominator)
     12 math.fraction({n: numerator, d: denominator})
     13 math.fraction(matrix: Array | Matrix)         Turn all matrix entries
     14                                               into fractions
     15 ```
     16 
     17 ### Parameters
     18 
     19 Parameter | Type | Description
     20 --------- | ---- | -----------
     21 `args` | number &#124; string &#124; Fraction &#124; BigNumber &#124; Array &#124; Matrix |  Arguments specifying the numerator and denominator of the fraction
     22 
     23 ### Returns
     24 
     25 Type | Description
     26 ---- | -----------
     27 Fraction &#124; Array &#124; Matrix | Returns a fraction
     28 
     29 
     30 ## Examples
     31 
     32 ```js
     33 math.fraction(1, 3)
     34 math.fraction('2/3')
     35 math.fraction({n: 2, d: 3})
     36 math.fraction([0.2, 0.25, 1.25])
     37 ```
     38 
     39 
     40 ## See also
     41 
     42 [bignumber](bignumber.md),
     43 [number](number.md),
     44 [string](string.md),
     45 [unit](unit.md)