Skip to main content
7-Bedrock
July 27, 2022
Solved

Inequality Help

Hello, sorry if this isn't the correct place to post but please help me out. I have the following eqn. 

X:= a + b <= c + d = 0

 

How do I get X to be defined as the lesser of the two. I want it to be defined as C+D if it is smaller, Not 0 or 1.

It is only returning 0 or 1 depending on if the statement is true or false. 

 

7-Bedrock
July 27, 2022

Thanks for the response but a better solution I figured out is as follows:

 

X := if(a+b<=c+d,a+b,c+d) This allows the inequality to return the value instead of 1 or 0

5 replies

23-Emerald IV
July 27, 2022

Then you probably want:

X:=min(a+b, c+d)

X will get the value of a+b if that is smaller than (or equal to) c+d.

 

Success!
Luc

Translate
LL_103366397-BedrockAuthorAnswer
7-Bedrock
July 27, 2022

Thanks for the response but a better solution I figured out is as follows:

 

X := if(a+b<=c+d,a+b,c+d) This allows the inequality to return the value instead of 1 or 0

Translate
23-Emerald IV
July 28, 2022

Your IF statement is equivalent to the use of the min() function. The min() function is more compact.

 

Success!
Luc

Translate