Jamin, I had a situation a while back where at certain settings in the prefs for the number of digit places, that you would get weird results (off by one). This was a thread on AOL for a while. After finally convincing others that it was real,(Al Staffieri could duplicate the problem, praise him) Andy said it would be fixed later. It only occurs at certain settings of the floating arithmetic prefs, maybe the 8-6-8 setting. Not sure anymore. But I would get that same 1 off results when I used parentheses. I would get 1-(10)=-8 at times. ;) Robert Covington >Can someone please try this code for me. As the demo will show you, if >BOTH of the passed vars exceed 100001 and 10001, then the calculations >turn out incorrect! >I thought the brackets might be causing the long to be clipped to a >short, but in all cases the results are off by only 1 ?? > >Jamin > >---- Cut Here For Code Snippet ------ > >WINDOW OFF > >DIM gUserQuits% >END GLOBALS > > >LOCAL FN BadCalculation(VauleOne&,ValueTwo&) > PRINT VauleOne&;"-";ValueTwo&;" = "; > > Incorrect& = (VauleOne&) -ValueTwo& > Correct& = VauleOne& -ValueTwo& > > PRINT Incorrect&; > > IF Correct& <> Incorrect& THEN PRINT ;" <- WRONG! Should be:";Correct& >ELSE PRINT "" > >END FN > >WINDOW 1 >TEXT _monaco,9,0,0 > >FN BadCalculation(100000,10000) >FN BadCalculation(100001,10000) >FN BadCalculation(100000,10001) >FN BadCalculation(100001,10001) >FN BadCalculation(100002,10002) > >DO > HANDLEEVENTS >UNTIL gUserQuits% >END > >-- >To unsubscribe, send ANY message to <futurebasic-unsubscribe@...>