# Best moments to apply pow in games

Continue with the course i am very excited to learn this kind of things (well to refresh the knowledge ) . I did the exercise that Rick has explained in the video

and applying rounded methods like round, ceil or floor i can not see any change, my questions here are the next:

1. if in into my game i have a big result from a pow operation it worth to apply rounded method to see differences in the final result?

2. where is the best place in game to apply squaring, cubing , pow?

Hi @williamsnieves.
The reason youâ€™e not really seeing any difference when rounding with things like floor or ceiling is because when you raise a whole number to some power, the result will always be an integer.

Before you round any of your values, think about why you might be doing it and be careful of accidentally introducing rounding errors if you plan to use the values for another calculation down the road.

As for seeing a difference in rounding large numbers, it depends on what you mean.
If youâ€™re just storing a number in say an int, then it doesnâ€™t really matter what that number is. Itâ€™ll take up the same amount of memory regardless and your programming language wonâ€™t really care whether than number has been rounded or not.
If youâ€™re number is larger than what an int can store, then there are larger data types that may be able to store it. Otherwise, youâ€™d probably turn to scientific notation, which is something we touch on in a later lecture. In that case youâ€™d use an approach that does include some rounding but youâ€™d break the number into two parts.

When it comes to taking about the â€śbestâ€ť place to apply exponents, it depends on your game and what youâ€™re trying to achieve. If you need to multiply a number by itself multiple times then it can be easier to use the Pow function - imagine having to write out 2 * 2 * 2 * â€¦ 24 times!

1 Like

@garypettie thanks for the answer itâ€™s clarifying my doubts a lot. I will try to apply this kind of things in my games and then we will see the results

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.