Does anyone know if there are any difference in execution time for calculations using 32 bit float vs 64 bit double? Intiution says double should be slower for 32 bit processor and float slower on 64...
Type: Posts; User: ninebit
Does anyone know if there are any difference in execution time for calculations using 32 bit float vs 64 bit double? Intiution says double should be slower for 32 bit processor and float slower on 64...
And Salem... it is faster...
by using same way of thinking as you:
pure + - ops does not need to be optimized by compiler its already as fast as it can be.
the compiler can and will rearrange...
You forgot that INT_MAX is half of 4294967295...
Nope it does work both computational and mathematically
#include <stdio.h>
#include <limits.h>
int main(void) {
int a = INT_MAX;
int b = 20;
Oh, and by the way, xor swap does work with signed values... as opposed to what some other people here says... bit-fields does not care about what number it represent... just run this smal program...
If you are swaping ints (signed or unsigned) this functions works, and doesn't use an temporary variable (thus faster):
a = a + b;
b = a - b;
b = a - b;
Proof:
a = -5
b = 2
the only big difference when read a file in normal vs binary is excactly what you said, the system characters are treated as just bytes and nothing else. reading a line from a binary file would prove...
I agree that circle (sphere) should be used íf possible, since it easy and fast.
pixel precise, would be for a 2d game to test each pixel of the two collidion objects (bitmaps?) to see if there is...
The way to do it is to use collision in time.
Say you have two objects with pos and vel as follows:
p1 = (x, y) + t(a, b)
p2 = (z, w) + t(c, d)
where x, y (and z, w) is last frame pos, and...
Weeell chaps! That would depend on yer compiler wouldn't it?!? I meen: a pc program doesn't run in c code or even asm code, its run i machine code. Same things would apply to any console, handheld or...
#define NULL (void*)0
* you dont need to know about linked list to make a game.
* you dont need to know math to make a game.
* you dont need to know c/c++ to make a game.
You don't need to know c/c++ to know how to...
maybe you want to use virtual function tables (code your own) and dito for variables...
something like:
map<string, function_type> function_list;
addFunction(function_pointer,...
I've written my own string class, and compared that with std::string... I find it pretty hard to beat performance of the std::string... For some operations: yes, but overall? no way... If anyone...
Hello all, just a quick quest:
is half an unsigned int 0x80000000 or 0x7FFFFFFF?
0xFFFFFFFF / 2 = 0x7FFFFFFF
but
0x7FFFFFFF * 2 = 0xFFFFFFFE
SDL
yes they use the RDTSC on some level, but then it would be better/faster to use RDTSC directly, if you know how...
otherwise, use timeGetTime() under windows...easy to use, precision down to 5 ms...
max for unsigned long long is 18446744073709551615... i hope you realise how large that number is... hehe...
do this:
delete szBuffer;
szBuffer = NULL;
this macro is usefull:
#define SAFE_DELETE(p) if(p){ delete p; p = NULL; }
#define SAFE_DELETE_ARRAY(p) if(p){ delete [] p; p = NULL; }
ansi/iso c++ professional programmers handbook (the best... =)
design patterns for games on gamedev.net
game architecture and design
open gl specifications/documents
dirctx SDK (all you'll ever...
the way i have done it is not to post a form but to build the requeststring (like "\sendsms.asp?recipent=12345&msg=hello")and then request it. I donät know why you want to build a form before you...
linux...
has anyone read all these questions??
The memory max should be the total of what the computer have in RAM and windows swap... if you wanna test, make a program that loops and allocates more memory every loop, the program will stop when...
when the compiler compiles the code, it creates obj files that are later linked together into the exe or dll or whatever...
When you know how to do your own list, stop reinventing the weel and use the std::list instead... easy, painless, optimized, portable...