A Continued Fraction Calculator version 1.2 September 2016

This interactive calculator page accompanies a full explanation of Continued Fractions.

Try these examples...
Select one. Input boxes will then be filled in for you. Press the ARROW button that has then been changed to or to do the conversion.
Results of calculations are shown in the RESULTS area. The and buttons will convert values and put them into the appropriate boxes too.
More help on input is displayed if you just rest your mouse/pointer over an input box and don't click on it.

Fraction & Decimal ↔ CF C A L C U L A T O R    

Fraction:
+
--

 

Continued Fraction:
[ ,
]
  
Negative terms:

Decimal number:
the best fractions with
denominators to
in best-fit order: in denominator order:
smallest denominator best approximations

R E S U L T S


The Mathematical functions and constants available in the 'Decimal number' input box are:
Note that they are case-sensitive so must be input exactly as given in the left-hand column.
NameDescriptionExample and Notes
+ – * / ( )Arithmetic operations and brackets2*3+4/(5-1) → 7
abs the absolute value (positive size) abs(-3.9) → 3.9
abs(3.9) → 3.9
acos arc cosine, the angle for a given cosine acos(0.5) → 1.0471975511965979
acos(0.5)/Pi*180 → 60.00000000000001 (degrees)
asin arc sine, the angle for a given sine asin(sqrt(3)/2)/Pi*180 → 60 (degrees)
atan arc tangent, the angle A for a given tangent
-π/2 ≤ A ≤ π/2
4 * atan(1) → 3.141592653589793
which is π
atan2 ang2(y,x) is the anticlockwise angle A at (0,0)
between the x>0 axis and the point(x,y)
-π ≤ A ≤ π
atan2(1,-1)/Pi*180 → 135 (degrees)
ceil round up to the nearest integer ceil(-3.9) → -3, ceil(-3.1) → -3
ceil(3.1) → 4, ceil(3.9) → 4
cos cosine of an angle (in radians) cos(60*Pi/180) → 0.5000000000000001
cos(Pi) → -1
E e E → 2.718281828459045
exp exp(p) means e to the power of pexp(1) → 2.718281828459045
floor round down to the nearest integer floor(-3.9) → -4, floor(-3.1) → -4
floor(3.1) → 3, floor(3.9) → 3
log log to base e
logb(x) is log(x)/log(b)
log(E) → 1
log(sqrt(E)) → 0.5
log(3)/log(2) → 1.584962500721156 is log2(3)
Phi golden section Φ=(√5 + 1)/2Phi → 1.618033988749895
phi golden section φ=(√5 – 1)/2phi → 0.6180339887498949
Pi, pi πPi → 3.141592653589793
pow pow(x,p) means xp pow(2,3) → 8
pow(3,2) → 9
pow(2,log(3)/log(2)) → 3
random a random number between 0 and 1 random() → 0.8027669817931609
random() → 0.8921109901820881
round round to the nearest integer round(-3.9) → -4, round(-3.1) → -3
round(3.9) → 4, round(3.1) → 3
sin sine of an angle (in radians) sin(Pi/2) → 1
sqrt square root sqrt(2) → 1.4142135623730951
tan tangent of an angle (in radians) tan(Pi/4) → 0.9999999999999999
>   >=
<   <=
==   !=
comparisons between two values, gives true or false
use in the Conditional part of (?:) expressions
Pi>2 → true
cos(Pi/3)==0.5 → false but should be true
This is caused by rounding in the final computed digit
Better is: abs(cos(Pi/3)-0.5)<0.0000001 → true
( expr ? t : f)conditional expression;
if expr is true then t is evaluated as the result,
if false then f is evaluated as the result
(sqrt(10)>=3 ? 4 : 3) → 4
fib, Fib or FFib(n) is the n-th Fibonacci numberF(10) → 55, Fib(-5) → 5
luc, Luc or LLuc(n) is the n-th Lucas numberL(10) → 123, Luc(0) → 2
GG(a,b,n) is the n-th General Fibonacci number where G(a,b,0)=a,G(a,b,1)=bG(3,1,5) → 14, G(1,3,-4) → -4

Valid HTML 4.01! © 2003-2016 Dr Ron Knott      enquiry (at) ronknott (dot) com
updated: 21 September 2016