Not sure what BASIC variant you're using, but the one I use doesn't support signed numbers, so x < 0 is a non functional test. -Denny > Dear reader, > > I gave a 16f628a these tasks to calculate(in basic) > > All variables are WORD > > IF ((Second_Value - First_Value) < 0) THEN > Difference_Between_F_And_S_Value = Second_Value - First_Value > Difference_Between_S_And_T_Value = Third_Value - Second_Value > ELSE > Difference_Between_F_And_S_Value = First_Value - Second_Value > Difference_Between_S_And_T_Value = Second_Value - Third_Value > ENDIF > > Difference_Between_Two_Points_As_Reference = Point_Two - Point_One > > Steps_Between_F_And_S_Value = (752 * > Difference_Between_F_And_S_Value) / > Difference_Between_Two_Points_As_Reference > > Steps_Between_S_And_T_Value = (752 * > Difference_Between_S_And_T_Value) / > Difference_Between_Two_Points_As_Reference > > These are the values being used > > Code: > > First_Value 1423 > > Second_Value 951 > > Third_Value 931 > > Point_One 493 > > Point_Two 1702 > > Result: > > Steps_Between_F_And_S_Value 22 > > Steps_Between_S_And_T_Value 12 > > > According to my hand calculator and the PC's calculator > Steps_Between_F_And_S_Value and Steps_Between_S_And_T_Value contain > wrong results. What could be the reason for that ? > > Regards > > Thilo Klein > > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist