
well, depending on your compiler optimization and cpu architecture, the compiler is able to optimize it, removing the branch ... e.g. different revisions of sse provide opcodes for min/max of floats/doubles and different kinds of integers ... in those cases, your branchless code may be even slower, unless it isn't optimized to use these instructions as well :) i could not get rid of a jump with msvc80 maybe other compiler can do it (tell me if you find out)
i am mainly working with gcc and floating point code ... i stopped trying to optimize this kind of branching code, because the compiler did a very good job ... i don't have any experience with msvc, though ... tim -- tim@klingt.org http://tim.klingt.org I must say I find television very educational. The minute somebody turns it on, I go to the library and read a good book. Groucho Marx