Skip to content

The farey algorithm written in swift provided as a swift package

Notifications You must be signed in to change notification settings

wvabrinskas/FareyAlgorithm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FareyAlgorithm

Introduction

"In mathematics, the Farey sequence of order n is the sequence of completely reduced fractions, either between 0 and 1, or without this restriction,[a] which when in lowest terms have denominators less than or equal to n, arranged in order of increasing size.

With the restricted definition, each Farey sequence starts with the value 0, denoted by the fraction 0/1, and ends with the value 1, denoted by the fraction 1/1 (although some authors omit these terms)."

Usage

Farey is very simple to use to get the desired fration.

  • let result = Farey.get(number: 0.456)
    • returns the desired fraction as a Fraction object.

Resources

About

The farey algorithm written in swift provided as a swift package

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages