View Single Post
Old 18 June 2013, 22:41   #9
demolition
Unregistered User
 
demolition's Avatar
 
Join Date: Sep 2012
Location: Copenhagen / DK
Age: 43
Posts: 4,190
When multiplying floats in a loop, round off errors can quickly become significant.

To test your results, I put this into MATLAB:
Code:
f = zeros(1,36);
for i = 1:36
    f(i) = 2 ^ ((i - 1) / 12);
end

round(856 ./ f)
The output gave exactly the same numbers as your C implementation.
demolition is offline  
 
Page generated in 0.04206 seconds with 11 queries