float_to_fraction {lrstat} | R Documentation |
Converting a decimal to a fraction
Description
Converts a decimal to a fraction based on the algorithm from http://stackoverflow.com/a/5128558/221955.
Usage
float_to_fraction(x, tol = 1e-06)
Arguments
x |
The fraction in decimal form. |
tol |
The tolerance level for the conversion error. |
Author(s)
Kaifeng Lu, kaifenglu@gmail.com
Examples
float_to_fraction(5/3)
[Package lrstat version 0.2.15 Index]