Use copysign instead of ternary conditions for positive constants