Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
bit shift and mask
//gcc 7.4.0 #include <stdlib.h> #include <stdarg.h> #include <stdio.h> #include <float.h> int main(void) { float vout = 0; unsigned int v = 0; unsigned int data = 0; unsigned char highByte = 0; unsigned char lowByte = 0; vout = 20.47f; v = (vout * 100.0f) + 1; data = v; highByte = (v >> 3); lowByte = (v & 0x03); printf("Vout = %2.2f v = %u data = [0x%4X] \r\n", vout, v, data); printf("highbyte = [0x%2X] lowByte = [0x%02X] \r\n", highByte, lowByte); return 0; }
run
|
edit
|
history
|
help
0
2
2 size mas
#Define / Case/ If practice
B_141125_Repetidos
Leap year
Iterated sums
poist
a3 commented
purple ghost red orange blue skulls
Timestamp microsecond for C