• Stars
    star
    12
  • Rank 1,545,019 (Top 32 %)
  • Language
    Julia
  • License
    Other
  • Created about 11 years ago
  • Updated about 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Types and functions for working with continued fractions in Julia

ContinuedFractions.jl

Build Status codecov

Usage

julia> using ContinuedFractions

julia> cf = ContinuedFraction(sqrt(2))
ContinuedFraction{Int64}([1,2,2,2,2,2,2,2,2,2  …  2,2,2,2,2,2,2,2,2,3])

julia> collect(convergents(cf))
22-element Array{Rational{Int64},1}:
        0//1
        1//1
        3//2
        7//5
       17//12
       41//29
       99//70
      239//169
      577//408
     1393//985
         â‹®
    47321//33461
   114243//80782
   275807//195025
   665857//470832
  1607521//1136689
  3880899//2744210
  9369319//6625109
 22619537//15994428
 77227930//54608393

For additional significant digits you can use BigInt / BigFloat.

julia> cf = ContinuedFraction(sqrt(big(2)))
julia> collect(convergents(cf))

101-element Array{Rational{BigInt},1}:
                                       1//1                                      
                                       3//2                                      
                                       7//5                                      
                                      17//12                                     
                                      41//29                                     
                                      99//70                                     
                                     239//169                                    
                                     577//408                                    
                                    1393//985                                    
                                    3363//2378                                   
                                    8119//5741                                   
                                   19601//13860                                  
                                   47321//33461                                  
                                        â‹®                                        
     14085805418356991727446091676022499//9960168529794442859224531878561050     
     34006142477945877445895155433144599//24045973948151434586670623554583549    
     82098090374248746619236402542311697//58052116426097312032565778987728148    
    198202323226443370684367960517767993//140150206800346058651802181530039845   
    478502736827135487987972323577847683//338352530026789429336170142047807838   
   1155207796880714346660312607673463359//816855266853924917324142465625655521   
   2788918330588564181308597538924774401//1972063063734639263984455073299118880  
   6733044458057842709277507685523012161//4760981394323203445293052612223893281  
  16255007246704249599863612909970798723//11494025852381046154570560297746905442 
  39243058951466341909004733505464609607//27749033099085295754434173207717704165 
  94741125149636933417873079920900017937//66992092050551637663438906713182313772 
 228725309250740208744750893347264645481//161733217200188571081311986634082331709

More Repositories

1

ML_for_Hackers

Code accompanying the book "Machine Learning for Hackers"
R
3,650
star
2

BanditsBook

Code for my book on Multi-Armed Bandit Algorithms
R
881
star
3

MLNotes

Very concise notes on machine learning and statistics.
R
377
star
4

SimpleAintEasy

A compendium of the pitfalls and problems that arise when using standard statistical methods
R
241
star
5

julia_tutorials

Tutorials on Julia topics
Jupyter Notebook
192
star
6

JAGSExamples

Examples of statistical models implemented using JAGS
R
97
star
7

log4r

A log4j derivative for R.
R
90
star
8

Vega.jl

A Julia package for generating visualizations in Vega
Julia
84
star
9

r_recommendation_system

Data and code for the Dataists R recommendation system contest
R
75
star
10

Style.jl

Style guideline for Julia
74
star
11

JuliaVsR

Comparisons between Julia and R
HTML
58
star
12

bayesian_nonparametrics

Slides and code for Bayesian nonparametrics in R and Julia
R
53
star
13

StreamStats.jl

Compute statistics over data streams in pure Julia
Julia
48
star
14

Benchmarks.jl

A new benchmarking library for Julia
Julia
45
star
15

ASCIIPlots.jl

Generate simple plots as ASCII art in Julia
Julia
38
star
16

TextRegression

An R package that automates text regression analysis.
R
31
star
17

BehavioralEconomics

R package for behavioral economics
R
31
star
18

MNIST.jl

Tools for working with the MNIST data set
Julia
25
star
19

Volcanito.jl

A backend agnostic for tabular data operations in Julia
Julia
25
star
20

kNN.jl

The k-nearest neighbors algorithm in Julia
Julia
22
star
21

r-ORM

An ORM library for R.
19
star
22

Benchmark.jl

A package for benchmarking code and packages
Julia
18
star
23

BloomFilters.jl

Bloom filters in Julia
Julia
18
star
24

room_temperatures

Dataset of temperatures in 6 rooms of my home recorded once per minute
R
16
star
25

StatsFunctionsNotes

Jupyter notebooks showing to implement statistical functions.
Jupyter Notebook
14
star
26

HopfieldNets.jl

Hopfield networks in Julia
Julia
14
star
27

r_squared

Code for blog post on r-squared
R
13
star
28

Ranking.jl

Tools for ranking in Julia
Julia
11
star
29

CorruptCSVs

Examples of corrupt CSV files and how they trick various parsers
R
10
star
30

julia-function-docs

Repo for materials for coordinating work on improving Julia's function documentation
10
star
31

cumplyr

An extension of plyr that uses inequality constraints.
R
9
star
32

titlecase-itunes-tracks

A utility to rename the tracks in an iTunes library so that the artist, album and track name are all in proper English title case.
9
star
33

MySQL.jl

MySQL DBI driver
Julia
9
star
34

sudoku.jl

A simple Sudoku solver in Julia
Julia
8
star
35

IntertemporalChoiceHeuristics

Analysis pipeline for Psychological Science paper called "Money Earlier or Later? Simple Heuristics Explain Intertemporal Choices Better than Delay Discounting"
R
8
star
36

DataFramesIO.jl

Advanced import/export tools for DataFrames: Stata, SPSS, Excel, JSON
Julia
8
star
37

DG2012Tutorial.jl

Simple examples of SGD-style computations in Julia
Julia
8
star
38

computer_music

R functions for generating computer music.
R
8
star
39

Brainfuck.jl

A Brainfuck interpreter written in Julia
Julia
7
star
40

Resampling.jl

Tools for resampling data in Julia
Julia
7
star
41

analytics_x_prize

Code and data used for submissions to the Analytics X Prize
Python
7
star
42

IsingModels.jl

The Ising model as a Julian distribution
Julia
7
star
43

PowerAnalysis.jl

Tools for power analysis in Julia
Julia
7
star
44

spatial_statistics_in_r

Slides and code on spatial statistics in R.
7
star
45

FFIExamples.jl

Simple examples of Julia's FFI as of v0.4
Julia
7
star
46

HackerSchoolTalk

A talk to the Summer 2013 batch of Hacker School students
Ruby
7
star
47

KLDivergence.jl

KL-divergence estimation in Julia
Julia
7
star
48

TicTacToe.jl

Use Reinforcement Learning to teach a computer to play Tic-Tac-Toe
Julia
6
star
49

projecteuler.jl

Solutions to Project Euler problems in Julia
Julia
6
star
50

bayesian_canabalt

A Bayesian exploratory analysis of Canabalt scores.
R
6
star
51

JAGSIntro

A short intro to probabilistic programming using JAGS
R
6
star
52

TypeTree.jl

An interactive visualization of the Julia type hierarchy
JavaScript
6
star
53

regularization_slides

An introduction to statistical regularization
6
star
54

NaiveBayes.jl

Naive Bayes models in Julia
Julia
5
star
55

NearestNeighbors.jl

Data structures for nearest neighbor search
Julia
5
star
56

Proximal.jl

Translation of Parikh and Boyd code for proximal algorithms
Julia
5
star
57

SortableHTMLTables

A package for writing data frames as sortable HTML tables.
JavaScript
4
star
58

Loss.jl

Loss functions
Julia
4
star
59

senate_analyses

Statistical Analyses of the U.S. Senate
R
4
star
60

webcast_examples

Examples for O'Reilly webcast
R
4
star
61

utils.jl

Utility functions for Julia + R compatibility wrapper
Julia
4
star
62

bayesian-decryption

An example R program that decrypts text encrypted using a substitution cipher.
R
4
star
63

IntertemporalChoice

An R package for modeling intertemporal choice data.
4
star
64

stringops

An R library for manipulating strings.
4
star
65

DCStats.jl

IJulia Notebooks that provide a brief introduction to Julia for statistical programming
4
star
66

cran-function-usage-analysis

Code to spider CRAN, tokenize package source code and analyze function usage both within and across packages.
3
star
67

fastR

Examples of writing faster R code.
R
3
star
68

CSVReaders.jl

A CSV parsing toolkit for Julia
Julia
3
star
69

julia_nyhackr

Slides about Optimization in Julia for NY R Meetup
R
3
star
70

GiltTalk

Slides for course at Gilt
R
3
star
71

julia_package_system

A package system for Julia.
Julia
3
star
72

UCSD2014Talk

Talk to Bradley Voytek's Data Science class at UCSD
R
3
star
73

FourierDescriptors

Generate images using Fourier descriptors.
R
3
star
74

NYCMarathon

Statistical Analyses of the NYC Marathon
R
3
star
75

DataGotham.jl

IJulia Notebook with material for DataGotham tutorial on using Julia for data analysis
3
star
76

cran_analysis

Analyses of CRAN packages
R
3
star
77

SimpleML.jl

Textbook implementations of ML algorithms in Julia using Optim.jl
Julia
3
star
78

DataFrameDemo

A demo of DataFrame's in Julia.
3
star
79

Ridge.jl

Ridge regression and classification
Julia
3
star
80

Wordle.jl

A Julia library for solving Wordle puzzles.
Jupyter Notebook
3
star
81

fmri_utilities

A set of basic utility methods for analyzing fMRI data in R.
3
star
82

ProbabilisticModeling.jl

A BUGS-like language for describing probabilistic models in Julia
Julia
2
star
83

FiniteDiff.jl

A replacement for the finite-differencing code in Calculus.jl
Julia
2
star
84

abbReviations

Functions for dealing with common abbreviations.
R
2
star
85

winsorization_simulation_study

A simulation study of winsorization
R
2
star
86

NHSTExamples

Examples of how NHST really works
R
2
star
87

PackageTesting.jl

A standard for testing Julia packages
Julia
2
star
88

DesignSpace.jl

Show part of the design space for NullableArrays
Julia
2
star
89

ML4H.jl

Machine Learning for Hackers in Julia
Julia
2
star
90

HyperLogLog.jl

HyperLogLog in Julia
Julia
2
star
91

Calculus2.jl

A draft of a new interface for the Calculus package
Julia
2
star
92

sf_politics

Endorsement data for SF politics
R
2
star
93

Roxygen.jl

A Roxygen-like documentation package
Julia
2
star
94

SGD.jl

Fit models using SGD in Julia
Julia
2
star
95

ggplots

A wrapper library that provides functions for common plots using ggplot2.
R
2
star
96

clean

A utility to recursively purge directories of all files identified by a naming convention.
2
star
97

ncclab

Rails code for the NCC Lab's website.
JavaScript
2
star
98

stroop

The classic Stroop task in R.
R
2
star
99

CategoricalData.jl

Tools for working with categorical/ordinal data
Julia
2
star
100

FileFind.jl

File::Find implementation in Julia
Julia
2
star