float_to_fraction: Converting a decimal to a fraction

View source: R/RcppExports.R

float_to_fractionR 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)


lrstat documentation built on April 4, 2025, 2:24 a.m.