When i do preBYTEL = 2* pow(2,(2*(Preview-1)));
Preview is declared as int and preBYTEL as byte
With Preview= 2 Iget as result 3 instead of 4
when i decleare preBYTEL as float i get 4.00
but when i do then int x= int(preBYTEL); i still get x as 3
pow() is a float-type function. So when it returns 4.00 it might be 3.9999999... which when converted to your byte ends up as 3.
If you only need to do integer arithmetic, then do not use pow() do it with your own multiplies.
Because of your datatypes I gather you only want 1, 2, 4, 8 .. for input values 0, 1, 2, 3 which is better (and MUCH faster) done by preBYTEL = 1<<Preview See << - Arduino Reference
I wonder if pow is returning a result an ulp below 4.0 (eg something like 3.9999999) - if so, converting to int would round it down to 3, but a float would get rounded up to 4.0 when being printed.
You can try rounding off, eg:
preBYTEL = 2* (pow(2,(2*(Preview-1)))+0.5);
Or if you specifically need powers of 2 you can use left shifts: