[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[sc-users] Re: How many years?



I have this but lacks precision...

a = 1 / 3; // 0.33333333333333
b = a * 3; // 1 why?
c = a + a + a; // 1 why?

// hmmmmm...

0.33333333333333 + 0.33333333333333 + 0.33333333333333; // 0.99999999999999
d = 1 - 0.99999999999999;
d * 60 * 60 * 24 * 365 * 3174

// ...mmmmmmmm...

2010/9/18 Lucas Samaruga <samarugalucas@xxxxxxxxx>
are the values rounded?

2010/9/18 Lucas Samaruga <samarugalucas@xxxxxxxxx>

Hello

If I have two pulses the first at 1 second and the second at 1/3, how can I calculate the time it will take for that second rhythm to have an offset of 1ms from the first? (with a 32bit floating point)

like in this case

Ppar([
  Pbind(\dur, 1),
  Pbind(\dur, 1/3)
]).play;

The periodic part confuses me in calculation :-S

Thanks
Lucas