Previous | Next | LK
Topic: Calculating in WINCMES
Conf: LK, Msg: 184
From: Troy Braman (bramanta@pweh.com)
Date: 4/15/1998 12:09 PM

Hi,
I’m trying to do a simple math calculation by using a value from a save point
Such as “X2” and subtracting it with a R variable, as shown below:



**XP
Point User Co-ordinates
Number X Y Z
001 19.92360 .0000 -1.34721
002 .76900 -24.4511 20.78738



CMES PROGRAM
R1=.76900
R2=X2 \! The value of X2 is .76900

R3=R2-R1

! OUT PUT VALUES
OP,R1
OP,R2
OP,R3 \VALUE IS = TO 0.0000

IF,R3,LESS,EQUAL,GREATER


:LESS
OP,'R3 LESS < 0'
ET

:EQUAL
OP,'R3 EQUAL = 0'
ET

:GREATER
OP,'R3 GREATER > 0'
ET


The value of R3 = 0.000, but at the IF statement, it shows it as Less < 0 and continues at the label :Less, when it should go to the EQUAL label.

My question is WHY IS THAT?

Also, I’ve had at times when you subtract 1 - 1(assigning values to I variables), CMES results are 1. Or 1 - 0 and CMES results are 0. ???????

It seems at times (not all the time) that CMES is not consistent in its calculations.

Again, WHY IS THAT?