Search code examples
mathieee-754floating-point-precisionfloating-point-conversion

how to convert a binary exponent to decimal?


I am stuck with converting the smallest denormalized double precision number which is 2^-1074 to one in the form of power of 10. Any help regarding how can I do this will be appreciated.

Thank You


Solution

  • Use 2^10 approx 10^3 to get 2^1070 approx. 10^(3*107)=10^321. Combine with 2^4=16...


    To get the correct result, compute

    log10(2^1074)=1074*log10(2)=323.306215343116
    

    and take the integer part.