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

Inequality Help

  • July 27, 2022
  • 1 reply
  • 2524 views

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. 

 

Best answer by LL_10336639

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

1 reply

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

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

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