Home > other >  How quickly according to a variable is worth to the many variables of different value
How quickly according to a variable is worth to the many variables of different value

Time:04-20

Suppose you have a series of variables a, b, c... As the X value range and do different change
For example,
When X [0 0100), a=1, X [1000200 0), a=3, X [between 0 2000500), a=5
When X [0250 0), b=100, X [2500450 0), b=200, X in (4500500), b=800
When X (0300), c=20, X in (300800), c=50, X [800320 0), c=90
Etc.
Should use what method, when the value of X is given, able to quickly get a, b, c... The value of? (if the if... The else... Will be slower)
  • Related