Download The xint bundle

Transcript
30 Commands of the xintcfrac package
\xintFrac{\xintGCtoF {{1/2}+{2/3}/{4/5}+{1/2}/{1/5}+{3/2}/{5/3}}} \]
1
+
2
2
3
4
5
=
1
2
+
1
5
+
4270
4140
3
2
5
3
The macro tries its best not to accumulate superfluous factor in the denominators, but
doesn’t reduce the fraction to irreducible form before returning it and does not do simplifications which would be obvious to a human.
30.15 \xintCstoCv
f⋆
\xintCstoCv{a,b,c,d,...,z} returns the sequence of the corresponding convergents,
each one within braces.
It is allowed to use fractions as coefficients (the computed convergents have then no
reason to be the real convergents of the final fraction). When the coefficients are integers,
the convergents are irreducible fractions, but otherwise it is not necessarily the case.
\xintListWithSep:{\xintCstoCv{1,2,3,4,5,6}}
1/1:3/2:10/7:43/30:225/157:1393/972
\xintListWithSep:{\xintCstoCv{1,1/2,1/3,1/4,1/5,1/6}}
1/1:3/1:9/7:45/19:225/159:1575/729
\[\xintListWithSep{\to}{\xintApply\xintFrac{\xintCstoCv
{\xintPow {-.3}{-5},7.3/4.57,\xintCstoF{3/4,9,-1/3}}}}\]
−72888949
−2700356878
−100000
→
→
243
177390
6567804
30.16 \xintCtoCv
f⋆
\xintCtoCv{{a}{b}{c}...{z}} returns the sequence of the corresponding convergents,
New with each one within braces.
1.09m
\oodef\test{\xintCtoCv {11111111111}}\texttt{\meaning\test}
macro:->{1/1}{2/1}{3/2}{5/3}{8/5}{13/8}{21/13}{34/21}{55/34}{89/55}{144/89}
30.17 \xintGCtoCv
f⋆
\xintGCtoCv{a+b/c+d/e+f/g+......+v/w+x/y} returns the list of the corresponding
convergents. The coefficients may be fractions, but must then be inside braces. Or they
may be macros, too.
The convergents will in the general case be reducible. To put them into irreducible form,
one needs one more step, for example it can be done with \xintApply\xintIrr.
\[\xintListWithSep{,}{\xintApply\xintFrac
{\xintGCtoCv{3+{-2}/{7/2}+{3/4}/12+{-56}/3}}}\]
\[\xintListWithSep{,}{\xintApply\xintFrac{\xintApply\xintIrr
{\xintGCtoCv{3+{-2}/{7/2}+{3/4}/12+{-56}/3}}}}\]
3,
17 834 1306
,
,
7 342 542
143