# Macro Library fractions

Fraction operations library

- fractionrand
- fractiondiffdrands
- fractiondiffdrandsfrom
- fractionparse
- fractiontomixed
- fractiontodecimal
- fractionreduce
- fractionadd
- fractionsubtract
- fractionmultiply
- fractiondivide
- fractionneg
- fractionpower
- fractionroot

### fractionrand

fractionrand(denom)
returns a proper reduced fraction with the given denominator

### fractiondiffdrands

fractiondiffdrands(min,max,n) {
returns n fractions with different denominators from min to max

### fractiondiffdrandsfrom

fractiondiffdrandsfrom(list,n) {
returns n fractions with different denominators from the list

### fractionparse

fractionparse(fraction)
converts a fraction into an array(num, denom)

### fractiontomixed

fractiontomixed(f)
converts a fraction string to a mixed number string

### fractiontodecimal

fractiontodecimal(f)

### fractionreduce

fractionreduce(f)
takes a fraction string or array(num,denom)
returns a reduced fraction string

### fractionadd

fractionadd(f1,f2,[f3,f4,...])
adds a set of fractions, returning a reduced fraction sum

### fractionsubtract

fractionsubtract(f1,f2,[f3,f4,...])
subtract a set of fractions, returning a reduced fraction difference
f1 - f2 - f3 - f4 etc.

### fractionmultiply

fractionmultiply(f1,f2,[f3,f4,...])
multiply a set of fractions, returning a reduced fraction

### fractiondivide

fractiondivide(f1,f2,[f3,f4,...])
divide a set of fractions, returning a reduced fraction
f1 -: f2 -: f3 -: f4

### fractionneg

fractionneg(frac)
change the sign of a fraction

### fractionpower

fractionpower(frac, power)
raises a fraction to a power

### fractionroot

fractionroot(frac, [root])
finds the root of the fraction (defaults to square root), rationalizing
the denominator. The output is a string.