Need a unique gift idea?
A Pastebin account makes a great Christmas gift
SHARE
TWEET

Untitled

a guest Aug 10th, 2018 74 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. #include <stdio.h>
  2.  
  3. int main() {
  4.     unsigned int z;
  5.     int expo = 0;
  6.     scanf("%u", &z);
  7.     float unsignedToFloat(unsigned int x) {
  8.     }
  9.     /*float unsignedToFloat(unsigned int x) {
  10.         float result;
  11.         result = (float)x;
  12.         return result;
  13.     }*/
  14.     void exponent(unsigned int x) {
  15.         x = x / 2;
  16.         if (x > 1) {
  17.             expo = expo + 1;
  18.             exponent(x);
  19.         }
  20.         if(x == 1) {
  21.             expo = expo + 1;
  22.         }
  23.     }
  24.     exponent(z);
  25.     printf("%i\n",expo);
  26.     unsigned int flo = expo + 127;
  27.     printf("%i\n", flo);
  28.     unsigned int big = 2 << expo;
  29.     printf("%i\n", big);
  30.     unsigned int left = z - big;
  31.     printf("%i\n", left);
  32.     unsigned int done = ((flo << 23) + left);
  33.     printf("%i\n",done);
  34.     return 0;
  35. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top