fork(6) download
  1. #include <stdio.h>
  2. #include <stdint.h>
  3.  
  4. int main(void) {
  5. uint16_t raw = 0x843B ;
  6. uint16_t result, exponent;
  7. float lux;
  8.  
  9. result = raw & 0x0FFF;
  10. exponent = (raw>>12) & 0x000F;
  11.  
  12. lux=0.01*(1<<exponent)*result;
  13.  
  14. printf("%f\n", lux);
  15. return 0;
  16. }
  17.  
Success #stdin #stdout 0s 2156KB
stdin
Standard input is empty
stdout
2772.479980