# need explanation

This is a discussion on need explanation within the C Programming forums, part of the General Programming Boards category; I 'm trying to read and understand code for calculating FFT, I'm having problems with understanding this part: Code: m ...

1. ## need explanation

I 'm trying to read and understand code for calculating FFT, I'm having problems with understanding this part:
Code:
```	m = int(log(Len)/log(2.0));
return(-1);
}```
but I don't know what 1<<m means?
Thanks!

2. >but I don't know what 1<<m means?
It means to shift the binary value of 1 to the left by m bits and fill the vacated bits with 0. Assuming 8 bits for simplicity, here is the progression of m being 0 to 6:
Code:
```1 == 0000001

m = 0: 0000001
m = 1: 0000010
m = 2: 0000100
m = 3: 0001000
m = 4: 0010000
m = 5: 0100000
m = 6: 1000000```
Notice the pattern? Apply that to the rest of the algorithm and see what you come up with.

3. what is this int(expr) function?
did you mean to type (int) expr ?

4. int(expression) is another form of casting. While I haven't seen it in C I have seen it in C++

5. Agree with Prelude;

Also, when shifting to the left you are actually multiplying by a power of 2 each time.

Notice the pattern Prelude spelled out.

6. >While I haven't seen it in C I have seen it in C++
That's because it isn't legal C.

7. That would explain why I hadn't seen it in C before