drsounds / mingus

Automatically exported from code.google.com/p/mingus
GNU General Public License v3.0
0 stars 0 forks source link

value.dots can be a one liner #32

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The series partly generated by value.dots is the geometric series with the
common ratio 1/2 (http://en.wikipedia.org/wiki/Geometric_series). Which can
be written as 
(1.0 - 0.5 ** nr) / 0.5

The whole function thus becomes:
return value / ((1.0 - 0.5 ** nr) / 0.5)

Original issue reported on code.google.com by Rhijnauwen@gmail.com on 11 Feb 2009 at 3:37

GoogleCodeExporter commented 9 years ago
0.5 * value / (1.0 - 0.5 ** nr)

Original comment by Rhijnauwen@gmail.com on 11 Feb 2009 at 3:42

GoogleCodeExporter commented 9 years ago
0.5 * value / (1.0 - 0.5 ** (nr + 1))

;)

Original comment by Rhijnauwen@gmail.com on 11 Feb 2009 at 3:44

GoogleCodeExporter commented 9 years ago
Fixed. Version > 0.3.9.2 contains the enhancement.

Original comment by Rhijnauwen@gmail.com on 1 Mar 2009 at 7:05