¡@

Home 

2014/10/15 ¤U¤È 10:11:20

iphone Programming Glossary: maxdenominator

Convert decimal to fraction in Objective-C?

http://stackoverflow.com/questions/5552537/convert-decimal-to-fraction-in-objective-c

from Arno Formella May 2008 Function wrapper by Regexident April 2011 usage fractionFromReal double realNumber long maxDenominator realNumber is real number to approx maxDenominator is the maximum denominator allowed based on the theory of continued fractions.. Regexident April 2011 usage fractionFromReal double realNumber long maxDenominator realNumber is real number to approx maxDenominator is the maximum denominator allowed based on the theory of continued fractions if x a1 1 a2 1 a3 1 a4 ... then best approximation.. terms we just keep the last partial product of these matrices. Fraction fractionFromReal double realNumber long maxDenominator double atof int atoi void exit long m 2 2 double startx long ai startx realNumber initialize matrix m 0 0 m 1 1 1 m 0 1..