cfrac2simple {contFracR} | R Documentation |
Function to Convert Continued Fraction to Simple Fraction.
Description
Given a vector of denominators and optionally numerators for a continued fraction, return the "simple" continued fraction where all numerators are 1. In addition, return the exact "simple" fraction x/y where both are integers.
Usage
cfrac2simple(denom, num =1, ...)
Arguments
denom |
A vector of values representing the standard |
num |
A vector of values representing the numerators in a continued fraction. The default is |
... |
Reserved for future use |
Value
A list containing:
intfrac
,the integer fraction as a bigq
value.
denom
, the denominator sequence for the continued fraction with all numerators equal to one.
Author(s)
Carl Witthoft, carl@witthoft.com
See Also
Examples
foon <- c(1,3,5,7,9)
food <- c(1,2,4,6,8,10)
foosimple <- cfrac2simple(denom =food, num=foon)
# compare with these two:
cfrac2num(den=food, num= foon)
cfrac2num(den=foosimple$denom)
[Package contFracR version 1.2.1 Index]