Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!srcsip!coltrane!carpent From: carpent@coltrane.SRC.Honeywell.COM (Todd Carpenter) Newsgroups: comp.sys.amiga Subject: C help Message-ID: <19888@srcsip.UUCP> Date: 3 Apr 89 18:35:19 GMT Sender: news@src.honeywell.COM Lines: 48 Greetings, oh great and mighty C wizards! I beg of you to aid a poor and distraught traveller through the wide and turbulent C! I have 2 arrays. One describes the current state of a system, the next describes a possible future state. The arrays are unsigned shorts. The future state may be as simple as changing 1 of the values. I calculate the future state often, and rarely actually accept it. Therefore, each time I must obtain a copy of the current state, and make a change to it. This is time consuming. BTW, I am using Lattice 5.0. This boils down to: void moo(state,new_state) ushort state[NUM_STATES], new_state[NUM_STATES]; { ushort i; for (i = 0; i != NUM_STATES; i++) new_state[i] = state[i]; ... } Anyone have any significantly faster ideas? Blitter? Number of states may be up to 256. In other news, I also do lots of math with this, but can do it in integer space (i.e., for some of this I don't need floating point). However, if I remember right, all divides in C are, by definition, done in double floating point. I have the A2620, but an integer divide is *still* faster than a double float on the 68881. So, if I have something like: unsigned moo() unsigned i,j,k; { return(i*j/k); /* or any other obscure equation where I can afford */ /* operations */ } How do I constrain it to integer ops? Remember, I have Lattice 5.0. email is fine. Thanks, oh wise and mighty ones! I have sacrificed a pizza to thine eternal glory!