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
ajr
Goodone for understanding array passing
pllkkj
Lab 7 v1.0
1.4 Thread IDs
Maximum of Arrays
Project 4 v.6
Max successs
more_than_one_break_in_loop
888 BONUS LAB 1