@apz28, I can't figure out the intent here. To convert result of abs to an unsigned?
The function logic works only for unsigned type and the parameter value can be altered in body hence Unqual. If not Unqual, must declare a local var and make a copy. Just asking if this can be done to avoid a cast by caller