# Revision history [back]

### Defining a function and forcing max or min value

Hi,

Is it possible to define a funtion, say f, and have it be the maximum (or minimum) of another function and a constant?

Example (pseudo-script): if g(x)=log(abs(x)), let f(x)=g(x) if g(x)<0, and f(x)=0 for all g(x)<0

Thanks N.C.

### Defining a function and forcing max or min value

Hi,

Is it possible to define a funtion, say f, and have it be the maximum (or minimum) of another function and a constant?

Example (pseudo-script): if g(x)=log(abs(x)), let f(x)=g(x) if g(x)<0, g(x)>0, and f(x)=0 for all g(x)<0

Thanks N.C.

 3 retagged kcrisman 12212 ●40 ●133 ●252

### Defining a function and forcing max or min value

Hi,

Is it possible to define a funtion, say f, and have it be the maximum (or minimum) of another function and a constant?

Example (pseudo-script): if g(x)=log(abs(x)), let f(x)=g(x) if g(x)>0, and f(x)=0 for all g(x)<0

Thanks N.C.