Answer the question
In order to leave comments, you need to log in
Can it be expressed in a formula?
I accidentally stumbled upon the schedule and conditions, I became interested in whether these conditions can be expressed in one formula.
Y = 0 for X < 3
Y = 2 for X >= 3 and X < 6
Y = 4 for X > 6
Answer the question
In order to leave comments, you need to log in
What type of record do you need.
In mathematics, like this:
In JS, you can write like this:
y = 4*(x>6) || 2*(x>=3) || 0
options mass
Yes, in mathematical notation, a curly bracket with 3 conditions is used for this.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question