# Thread: Maximum of two values

1. I know this is probably a pretty stupid question, but I'm a programmer and I'm trying to describe a function which does a math calculation in a mathematical format. Stripped of all but the relevant portion, this is what I'm trying to describe:

Code:
if (x-y) < 0 then 0 else (x-y)
Is there a mathematical symbol or set of symbols used to represent that? Thanks and sorry for bothering you with such a simple question. (I don't know how to phrase this as a good Google search)

2.

3. yes..it's math symbol..

4. Originally Posted by VentureFree
I know this is probably a pretty stupid question, but I'm a programmer and I'm trying to describe a function which does a math calculation in a mathematical format. Stripped of all but the relevant portion, this is what I'm trying to describe:

Code:
if (x-y) < 0 then 0 else (x-y)
Is there a mathematical symbol or set of symbols used to represent that? Thanks and sorry for bothering you with such a simple question. (I don't know how to phrase this as a good Google search)
That's not really clear what happening there

Code:
if (x-y) < 0 then z= 0 else z=(x-y)
Would make more sense.

There is a special function in C to do that in a shorthand notation.
Code:
z = (x > y) ? 0 : (x-y);

5. Else just try max(x-y, 0)

The standard notation is

6. smokey's method is the way I prefer to do it. But if you're set on a mathematical function try:

 Bookmarks
##### Bookmarks
 Posting Permissions
 You may not post new threads You may not post replies You may not post attachments You may not edit your posts   BB code is On Smilies are On [IMG] code is On [VIDEO] code is On HTML code is Off Trackbacks are Off Pingbacks are Off Refbacks are On Terms of Use Agreement