誰得。
#include<stdio.h> #include <math.h> float toFloat(int x){ int s = (x >> 31) == 0 ? 1 : -1; int e = (x >> 23) & 0xFF; int m = (e == 0) ? (x & 0x7FFFFF) << 1 : (x & 0x7FFFFF) | 0x800000; return (float) (s * m * pow(2, e - 150)); } int main(){ int x = 0x3E200000; printf("%lf\n", toFloat(x)); // 0.156250 printf("%d", toFloat(x) == 0.156250); // 0.156250(多分true) return 0; }