Cancel
Showing results for
Did you mean:

Find smalles value variable Creator

Hi everyone,

I have the following problem. I defined four different variables in a method. For example, they have the values respectively 1, 2, 3 and 4. Which word/method do I use to find the variable with the smallest value?

Regards,

Michael

6 REPLIES 6

Re: Find smalles value variable  Gears Esteemed Contributor

the method is "min", but you can only pass two parameters. For 4 numbers, you need to combine 3 min-Methods:

`min(1,min(2,min(3,4)))`
 Steffen Bangsowfreelance simulation specialist  web: www.bangsow.eumail: steffen@bangsow.net Re: Find smalles value variable  Siemens Phenom

I would use the function min, which returns the smaller of two values.

Example:

is
a,b,c,d,m: real;
do
a := z_uniform(1,0,10);
b := z_uniform(1,0,10);
c := z_uniform(1,0,10);
d := z_uniform(1,0,10);

m := min(min(a,b), min(c,d));

print a, " ", b, " ", c, " ", d, "  min=", m;
end;

_________________________________________________________________
Did you like the answer? Then click the Thumbs Up button.

Re: Find smalles value variable Creator

Thank you, Michael and Steffen!

Re: Find smalles value variable Valued Contributor

Hello,

Is it possible to find the "min" of a Date in a tablefile?

Say I have a column with three dates as follows:

2014/06/01

2014/07/01

2003/03/25

How would I find the "smallest" date (2003/03/25) from that column?

Thank you.

Re: Find smalles value variable  Siemens Phenom

Hi ET_Boys,

the table has a method min which you can use.

Just have a look in the online documention how to use it.

Regards,

Ralf
------------------------------------------------------------------------------------------------------
Did you like the answer? Then click the Thumbs Up button. 