11
votes
Accepted
Is there any performance penalty to unsigned integer underflow?
You didn't specify the processor or the compiler you are using.
On any of the x86 family and any compiler I'm aware of, the answer would be that overflow has no impact on performance whatsoever. This ...
7
votes
Is there any performance penalty to unsigned integer underflow?
No performance penalty
Generally the overflow / underflow (carry flag) is automatically set and does not have a performance penalty.
Avoid branching code
You suggest "having an if statement to ...
3
votes
Is there any performance penalty to unsigned integer underflow?
Unsigned integer overflow (and underflow) shouldn't have any noticeable impact on performance.
On top of that, based on Wikipedia - Integer Overflow, unsigned integer overflow is defined to wrap ...
2
votes
Is it possible to use the Unreal Engine as a big C++ library, without using the editor?
Starting a rough answer for this old question as I learn more about this functionality myself, yes it seems this functionality has been available since at least Unreal Engine 4.27. However, it's ...
2
votes
Accepted
Sanity Check on my Idea for an Event System for game
First of all, there is no "right" or "wrong" in software development. Only "works for you" or "doesn't work for you". So any advise about your software ...
2
votes
encapsulation, structs and global variables?
The only difference between a class and a struct is that members within a struct are automatically public.
You could just create a class for all the input:
...
1
vote
Is there any performance penalty to unsigned integer underflow?
Is there any performance penalty to unsigned integer underflow?
No.
There is no cost to the wrapping (modulo) behavior of arithmetic with unsigned integral types. Processors use same instructions ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
c++ × 4302opengl × 1001
directx × 309
sfml × 265
sdl × 229
architecture × 211
directx11 × 209
sdl2 × 182
collision-detection × 180
2d × 166
unreal-4 × 150
physics × 133
textures × 125
shaders × 122
mathematics × 119
3d × 114
rendering × 113
glsl × 105
hlsl × 84
directx9 × 83
software-engineering × 81
c × 81
entity-system × 79
graphics × 76
box2d × 75