Your right copy_sign is fine only with floating point (and even there I'm not sure it is portable). lowest() is probably the best then. standard says: "A finite value x such that there is no other finite value y where y < x.", which is perfectly fine here.