Here is how one can mathematically find the minimum and maximum of a set of two rational numbers. Whether you are programming something in a language that doesn’t have built in Min(...) and Max(...) such as VBScript (and choose not to use IF...ELSE) or you are simply curious on how minimum and maximum of two numbers can be calculated mathematically, here is something you may find useful. I can’t remember where exactly I learned this but I do know it was some time back in junior Comp. Sci. therefore remember that I didn’t come up with this myself.
You want to see this work? Well here are some examples.


1 Comment until now
Here is the reference
The Maximum and Minimum of Two Numbers Using the Quadratic Formula
Dan Kalman
The College Mathematics Journal, Vol. 15, No. 4 (Sep., 1984), pp. 329-330