DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Compare two numbers with tolerance

Hello,

 

I would like to compare two numbers and set an interval to. The first number is n1= 100 the second number is n2= 105

number = 0

If n1 = 105 + - 10 then

 

   number = number +1

 

End if 

 

The variable number should be 1 in this case. 

 

Thank you very much in advance.

 

With best regards, 

 

Mosquito

0 Kudos
Message 1 of 2
(5,425 Views)

Hi Mosquito,

 

you can try this:

 

dim a, b, c
a= 95
b= 105
c=100

 

if ( (C>A) AND (C<B) ) THEN
  Call msgbox("Test")
End If

 

Kind Regards,

 

Philipp K.

 

AE | NI Germany

0 Kudos
Message 2 of 2
(5,405 Views)