#include <stdio.h>
int getSize(int larger_dim){
if(larger_dim <= 1){
return 0;
}
int msb = 0;
while(larger_dim > 1){
larger_dim >>= 1;
msb++;
}
int level = msb + 1;
return level;
}
int main(void){
int n = 5;
printf("dim = %d\n", n);
printf("level = %d\n", getSize(n));
printf("size = %d", 1 << getSize(n));
return 0;
}
In this notespace, I will share my original journey of thinkering with IoT. The mission is to create a monitoring system to gather data from a drying device and save it into a datasheet.
Mar 29, 2025Programmer
Mar 17, 2025Strategy is a plan of change to achieve an objective
Sep 15, 2024Basic control requirements:
Jul 31, 2024or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up