Oh my God ... I found the solution, thanks for the hint DdlV that drove me the right direction.

It is indeed the '0' in the comparism that converts a to an int. If this is not wanted you have to write:

var b = ifelse(a > 0, a, 0.); <- it is the '.' behind the 0 that makes the difference.

I actually need more time to get along with the programming language than to develop trading strategies ...