C bitwise integer absolute value
// Absolute value for integers
int a = -4268;
// mask = a >> 31 -> (mask ^ a) - mask
int abs = ((a >> 31) ^ a) - (a >> 31);
Also in C:
- gura
- c printf right pad with space
- incompatible implicit declaration of built-in function ‘exit’
- sum of arrays
- how to create an array of char in c++
- ModuleNotFoundError: No module named 'cv2'
- c rand range
- visual studio code
- c random
- plt legend top right outside
- sidebar materializecss
- cant update windows
- how to free memory in c
- c program to find number of days in a month using switch case
- slurm array job
- for loop c
- set timezone in debian terminal
- how to break a loop in c
- allocating memory for 1Mb text file in C
- pthread_create
- functions in c
- how to remove a node from a linked list in c
- unable to locate package dos2unix
- add border to image android