From Wikipedia, the free encyclopedia
In computer programming, a bitwise operation operates on one or two bit patterns or binary numerals at the level of their individual bits. On many computers, bitwise operations are slightly faster than addition and subtraction operations and significantly faster than multiplication and division operations.
I dont know if there was already existing fast absolute value in this forum but Id like to share my own :lol: .
This is absolute value for short int. It will return a new value as unsigned short.
unsigned short abss(ushort g)
This is absolute value for int.
unsigned int absi(int g)
This is absolute value for long int.
unsigned long int absl(long int g)
Is this what you are looking for? :lol:
float absf(float g)
unsigned int *gg;
Another one :yes:
double absd(double g)
unsigned long int *gg;
gg=(unsigned long int*)&g;
Hope you like its performance :worthy: :sneaky: :lol: