Re: Finding Optimal Integer Ratio for Any Decimal Fraction
- To: mathgroup@smc.vnet.net
- Subject: [mg12293] Re: [mg12270] Finding Optimal Integer Ratio for Any Decimal Fraction
- From: Daniel Lichtblau <danl@wolfram.com>
- Date: Thu, 7 May 1998 18:51:29 -0400
- References: <199805050730.DAA17192@smc.vnet.net.>
Benjamin Tubb wrote: > > I'm trying to find an optimal integer ratio for any given decimal value > within two constraints: 1) a maximum denominator and 2) a specified > decimal precision of match accuracy. For example: given a maximum > denominator of 2048, what is the smallest lowest common denominator > (LCD) ratio equaling close to 1.00057779 with a precision to the fifth > decimal place (i.e. the first '7' in this case)? The intent is to > generate a table of LCD integer ratios for each of the 1200 cents in 12 > tone equal temperament. > > ---------------- > Benjamin Tubb > AIM: brtubb > brtubb@cybertron.com > http://home.cybertron.com/~brtubb No guarantees, but Rationalize with a tolerance specified may often be of assistance. For example, In[21]:= Rationalize[1.00057779, 10^-6] 1732 Out[21]= ---- 1731 In[23]:= N[%%]//InputForm Out[23]//InputForm= 1.000577700751011 Daniel Lichtblau Wolfram Research
- References:
- Finding Optimal Integer Ratio for Any Decimal Fraction
- From: "Benjamin Tubb" <brtubb@cybertron.com>
- Finding Optimal Integer Ratio for Any Decimal Fraction