Jump to content

Home

Open Slots in the playerstate_t


razorace

Recommended Posts

Two things: if you're working on Tenebrae modesty doesn't help (so you ARE an expert programmer, don't deny it :D ) and two: does it make much of a difference? Both work, maybe your version is more efficient and the change is noticeable when you use the function a lot but even so JK2 probably has some sort of absolute value function in q_math.c already (I only wrote this because I couldn't use the function from one of the .h files).

Link to comment
Share on other sites

in the original int power(int x, int y) function

if (!y) {
       return 0;
   }

this should be

if (!y) {
   if(!x)
       return NULL;
  else
       return 1;
   }

 

seeing as a^0 = 1, except a=0, where 0^0 is undefined

Link to comment
Share on other sites

Hmmm.... that's what my calculator is saying ... but why?

 

0 to the 0th power is 1, in fact, any number to the '0' power is 1, just as a number to the '1' power is itself.

 

Not really useful math, generally, I know that *I* had to whip out the calculator, but then again, I *always* whip out the calculator.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...