Why do the two below give different results? I need the second result to be the same as the first.
1 2 3 4 5 6
|
float mySampleRate = 44100.0f;
int phase = 4294967296.0f / mySampleRate * 1046.5f; // Phase is 101920256
float cycle = 1046.5f;
int phase = 4294967296.0f / mySampleRate * cycle; // Phase is 101920480
|
Windows 10, VS 2019
Last edited on
Code::Blocks gives the same results, floats or doubles. Some part of your code you didn't post is probably changing the value you are expecting.
Last edited on