Click here to Skip to main content
15,896,063 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: compression/Zip problem Pin
Rajesh R Subramanian9-Apr-09 1:31
professionalRajesh R Subramanian9-Apr-09 1:31 
GeneralRe: compression/Zip problem Pin
chandrakar ashish9-Apr-09 1:39
chandrakar ashish9-Apr-09 1:39 
AnswerRe: compression/Zip problem Pin
Rajesh R Subramanian9-Apr-09 0:44
professionalRajesh R Subramanian9-Apr-09 0:44 
AnswerRe: compression/Zip problem Pin
Divyang Mithaiwala9-Apr-09 0:54
Divyang Mithaiwala9-Apr-09 0:54 
Questionpointer casting Pin
Jorge8-Apr-09 23:48
Jorge8-Apr-09 23:48 
QuestionRe: pointer casting Pin
CPallini8-Apr-09 23:55
mveCPallini8-Apr-09 23:55 
AnswerRe: pointer casting Pin
Jorge9-Apr-09 0:07
Jorge9-Apr-09 0:07 
GeneralRe: pointer casting Pin
CPallini9-Apr-09 0:45
mveCPallini9-Apr-09 0:45 
The code is working fine, anyway it is not performing a conversion, it is interpreting the raw bits as a double.
You have the following string of bits (only the first two ints of the array matters):

                                 1                                   2
00000000 00000000 00000000 00000001 00000000 00000000 00000000 00000010


as a double it is
 00000000 00000000 00000000 00000001 00000000 00000000 00000000 00000010
 ^
 0 as sign (first bit on the left), i.e. positive number

 00000000 00000000 00000000 00000001 00000000 00000000 00000000 00000010
  ^---------^ 
       0 as exponent with in excess -1023 representation represents denormals when fraction is <> 0
       (as in your case).
 
 00000000 00000000 00000000 00000001 00000000 00000000 00000000 00000010
             ^---------------------------------------------------------^
        2^-20 + 2^-51 = 9,5367431685033920985006261616945e-7 as fraction

That gives, for a denormalized number


  fraction * 2^-1021 = 4,2439915839068072135877506064327e-314


Smile | :)

If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.

This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke

[My articles]

GeneralRe: pointer casting Pin
Rajesh R Subramanian9-Apr-09 1:19
professionalRajesh R Subramanian9-Apr-09 1:19 
GeneralRe: pointer casting Pin
CPallini9-Apr-09 1:55
mveCPallini9-Apr-09 1:55 
GeneralRe: pointer casting Pin
Rajesh R Subramanian9-Apr-09 2:09
professionalRajesh R Subramanian9-Apr-09 2:09 
GeneralRe: pointer casting Pin
Jorge9-Apr-09 1:37
Jorge9-Apr-09 1:37 
AnswerRe: pointer casting Pin
Rajesh R Subramanian9-Apr-09 0:38
professionalRajesh R Subramanian9-Apr-09 0:38 
GeneralRe: pointer casting Pin
Jorge9-Apr-09 1:08
Jorge9-Apr-09 1:08 
GeneralRe: pointer casting Pin
Rajesh R Subramanian9-Apr-09 1:13
professionalRajesh R Subramanian9-Apr-09 1:13 
GeneralRe: pointer casting Pin
Jorge9-Apr-09 1:40
Jorge9-Apr-09 1:40 
AnswerRe: pointer casting Pin
Divyang Mithaiwala9-Apr-09 1:01
Divyang Mithaiwala9-Apr-09 1:01 
GeneralRe: pointer casting Pin
Jorge9-Apr-09 1:19
Jorge9-Apr-09 1:19 
QuestionHeader file Pin
p_19608-Apr-09 21:25
p_19608-Apr-09 21:25 
AnswerRe: Header file Pin
«_Superman_»8-Apr-09 21:29
professional«_Superman_»8-Apr-09 21:29 
AnswerRe: Header file Pin
CPallini8-Apr-09 21:31
mveCPallini8-Apr-09 21:31 
AnswerRe: Header file Pin
ThatsAlok8-Apr-09 22:38
ThatsAlok8-Apr-09 22:38 
GeneralRe: Header file Pin
CPallini8-Apr-09 22:42
mveCPallini8-Apr-09 22:42 
AnswerRe: Header file Pin
Hamid_RT8-Apr-09 23:52
Hamid_RT8-Apr-09 23:52 
QuestionShellExecuteEx not working fine in case of Visual Studio 2008. Pin
Le@rner8-Apr-09 21:03
Le@rner8-Apr-09 21:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.