I have a C++ code that I'm trying to reuse on my C# project and I need some help. Here is the subject
for (int i = 0; i < numOfSamples; i++)
{
*(((double*)m_Buffer) + i)
= max(*(((double*)m_Buffer) + i*4), *(((double*)m_Buffer) + i*4 + 1));
}
where m_Buffer is array of float. This part of code read each 2 "floats" of array as a one "double" and then do some manipulations (shift it, choose max etc.) The question is - how can I do the same operation in C#.
For example, I have an array [12,45,26,32,07,89,14,11] and I have to transform items in position 0 and 1 (12 and 45) so that I will get a new number (type of double) where highest (I'm not sure - maybe lowest) part of bits will be formed from 12 and lowest - from 45