Turning rational numbers (or finite estimations of irrational numbers, ie. np.pi
) into fractional forms using concepts from the Farey algorithm.
- Clone the repository
git clone [email protected]:hwixley/Farey-Number-Fractioniser.git
- Install the requirements
pip3 install -r requirements.txt
- Run the script
python3 farey.py <precision> <rational-number>
The script currently has a strict order of non-optional inputs:
python3 farey.py <precision> <rational-number>
*This will be updated in future to use dynamic input flags (ie. -p <precision>
)
<precision>
- an integer value, this denotes the precision of the fraction to the specified number of decimal places<rational-number>
- a rational number in the form of a floating point or string special value, this denotes the number you are generating a fraction for- Special Values:
pi
,e
,phi
- Special Funcs:
sqrt[<num>]
,log[<num>]
,log2[<num>]
,ln[<num>]
,sin[<num>]
,cos[<num>]
,tan[<num>]
- Special Values: