Thread: % and timevar
View Single Post
  #12  
Old 02-23-2003, 09:50 PM
Com013 Com013 is offline
Registered User
Join Date: Aug 2002
Location: GMT+1
Posts: 381
Com013 is on a distinguished road
Quote:
Originally posted by Kaimetsu
dir+=2;
if(dir>3) dir-=4;
But aren't the npc attributes limited to a certain range? Then the dir wouldn't be able to get above 3. (I know, that would be no problem, you'd just use another variable).

And in some cases I'd use while(ndir > 3) instead of if(ndir > 3), just in case it is too big (Which is impossible at the given example).

But why is % slower? I think I've heard that modulo is quite a complex floating point operation, but we normaly have FPUs integrated in the CPUs and the FPU operation would still be faster than interpreting 3 additional Graal Script Commands, wouldn't it?
__________________
Com013
Former Admin of the LAT on Graal The Adventure

e-mail: [email protected]
Reply With Quote