View more

View more

View more

### Image of the Day Submit

IOTD | Top Screenshots

### The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.

# Costly Operations - how do you determine the expense?

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

### #1Anonymous Poster_Anonymous Poster_*  Guests

Posted 18 October 1999 - 05:40 AM

How do you know how costly an operation is? In response to my last question on unit vectors, the response was that we use unit vectors to avoid costly divides, but to me it seems as though it would be equally costly if not more so to convert vectors to unit vectors using square roots. Any general help would be greatly appreciated.

thanks

### #2mhkrause  Members

Posted 18 October 1999 - 05:40 AM

For that example, we don't convert to unit vectors before every single calculation, we do it once at startup, and then reuse the unit vectors. A couple squareroots once is trivial.

Generally, mathematical operations are ordered as follows, from most costly to least

FP SquareRoot
FP Divide
Integer Multiply
FP Multiply