correct and improve rectangular window function

correct window function
adjust commends
improve float_X casts
improve casting to float_X

improve casting to float_X in triangle window function
adjust comments
fix whitespaces