it is not unsigned its signed but positive thts y it is 0..
the order isnt reversed.. look at the code, the code 1st prints lowest order
byte then next and then next and then highest soo output is 102 102 -90 64

On Wed, Jul 13, 2011 at 8:08 PM, Piyush Kapoor <[email protected]> wrote:

> why is the order of numbers reversed?
>
>
> On Wed, Jul 13, 2011 at 8:07 PM, Anika Jain <[email protected]>wrote:
>
>> sorry its 01000000 not 11000000 coz 5.2 is a positive no. so sign bit is 0
>>
>>
>> On Wed, Jul 13, 2011 at 7:58 PM, Piyush Kapoor <[email protected]>wrote:
>>
>>> Shouldn't the value of "11000000" be -64????
>>>
>>>
>>> On Wed, Jul 13, 2011 at 4:53 PM, Anika Jain <[email protected]>wrote:
>>>
>>>> binary equivalent of 5.2 is
>>>> 101.0011001100110011001100110011(nonterminating)..
>>>>
>>>> now it is actually stored in normalised frorm in 32 bits..
>>>> like this
>>>> <--1 bit for sign---><-----8 bits for exponent-----><--------23 bits for
>>>> fraction------>
>>>> this is from higher order byte to lower order for little endian..
>>>>
>>>> if no. is positive sign bit is 0 else it is 1
>>>>
>>>> The rule says change your floating point no. in such a form that after
>>>> 1st digit that is 1 decimal point comes sooo
>>>> here it becomes like
>>>> 1.0100110011001100110011001100110011(nonterminating) * 2^2
>>>>
>>>> so i here get an exponent of 2 as 2 here.. now in exponent 8 bits this
>>>> exponent is stored as 127+exponent so here it becomes 10000001..
>>>>
>>>> now fraction here is clearly value after the decimal point i.e.
>>>> 01001100110011001100110011001100110011(non terminationg) but only 1st 23
>>>> bits are saved rest are left
>>>>
>>>> so finally wht we get is:
>>>>
>>>> 11000000 10100110 01100110 01100110
>>>> (64)          (-90)         (102)        (102)
>>>>
>>>>
>>>>
>>>> On Wed, Jul 13, 2011 at 2:49 PM, Piyush Kapoor <[email protected]>wrote:
>>>>
>>>>> why do we need a NthIntWithKBits() in this topic?
>>>>>
>>>>>
>>>>> On Tue, Jul 12, 2011 at 7:58 AM, oppilas . 
>>>>> <[email protected]>wrote:
>>>>>
>>>>>>
>>>>>>
>>>>>> On Mon, Jul 11, 2011 at 5:54 PM, Piyush Kapoor 
>>>>>> <[email protected]>wrote:
>>>>>>
>>>>>>> Can anybody give a full explanation
>>>>>>>
>>>>>>> http://ideone.com/K1QmV
>>>>>>
>>>>>>>  On Sat, Jul 9, 2011 at 10:49 PM, sunny agrawal <
>>>>>>> [email protected]> wrote:
>>>>>>>
>>>>>>>> try to find out the binary representation of float value 5.2
>>>>>>>>
>>>>>>>>
>>>>>>>> On Sat, Jul 9, 2011 at 10:46 PM, Sangeeta 
>>>>>>>> <[email protected]>wrote:
>>>>>>>>
>>>>>>>>> int main(){
>>>>>>>>> int i;
>>>>>>>>> float a=5.2;
>>>>>>>>> char *ptr;
>>>>>>>>> ptr=(char *)&a;
>>>>>>>>> for(i=0;i<=3;i++)
>>>>>>>>> printf("%d ",*ptr++);
>>>>>>>>> }
>>>>>>>>>
>>>>>>>>> output:
>>>>>>>>>  102 102 -90 64.explain?
>>>>>>>>>
>>>>>>>>> --
>>>>>>>>> You received this message because you are subscribed to the Google
>>>>>>>>> Groups "Algorithm Geeks" group.
>>>>>>>>> To post to this group, send email to [email protected].
>>>>>>>>> To unsubscribe from this group, send email to
>>>>>>>>> [email protected].
>>>>>>>>> For more options, visit this group at
>>>>>>>>> http://groups.google.com/group/algogeeks?hl=en.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>>> Sunny Aggrawal
>>>>>>>> B-Tech IV year,CSI
>>>>>>>> Indian Institute Of Technology,Roorkee
>>>>>>>>
>>>>>>>>
>>>>>>>>  --
>>>>>>>> You received this message because you are subscribed to the Google
>>>>>>>> Groups "Algorithm Geeks" group.
>>>>>>>> To post to this group, send email to [email protected].
>>>>>>>> To unsubscribe from this group, send email to
>>>>>>>> [email protected].
>>>>>>>> For more options, visit this group at
>>>>>>>> http://groups.google.com/group/algogeeks?hl=en.
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> *Regards,*
>>>>>>> *Piyush Kapoor,*
>>>>>>> *CSE-IT-BHU*
>>>>>>>
>>>>>>>  --
>>>>>>> You received this message because you are subscribed to the Google
>>>>>>> Groups "Algorithm Geeks" group.
>>>>>>> To post to this group, send email to [email protected].
>>>>>>> To unsubscribe from this group, send email to
>>>>>>> [email protected].
>>>>>>> For more options, visit this group at
>>>>>>> http://groups.google.com/group/algogeeks?hl=en.
>>>>>>>
>>>>>>
>>>>>>  --
>>>>>> You received this message because you are subscribed to the Google
>>>>>> Groups "Algorithm Geeks" group.
>>>>>> To post to this group, send email to [email protected].
>>>>>> To unsubscribe from this group, send email to
>>>>>> [email protected].
>>>>>> For more options, visit this group at
>>>>>> http://groups.google.com/group/algogeeks?hl=en.
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> *Regards,*
>>>>> *Piyush Kapoor,*
>>>>> *CSE-IT-BHU*
>>>>>
>>>>>  --
>>>>> You received this message because you are subscribed to the Google
>>>>> Groups "Algorithm Geeks" group.
>>>>> To post to this group, send email to [email protected].
>>>>> To unsubscribe from this group, send email to
>>>>> [email protected].
>>>>> For more options, visit this group at
>>>>> http://groups.google.com/group/algogeeks?hl=en.
>>>>>
>>>>
>>>>  --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "Algorithm Geeks" group.
>>>> To post to this group, send email to [email protected].
>>>> To unsubscribe from this group, send email to
>>>> [email protected].
>>>> For more options, visit this group at
>>>> http://groups.google.com/group/algogeeks?hl=en.
>>>>
>>>
>>>
>>>
>>> --
>>> *Regards,*
>>> *Piyush Kapoor,*
>>> *CSE-IT-BHU*
>>>
>>>  --
>>> You received this message because you are subscribed to the Google Groups
>>> "Algorithm Geeks" group.
>>> To post to this group, send email to [email protected].
>>> To unsubscribe from this group, send email to
>>> [email protected].
>>> For more options, visit this group at
>>> http://groups.google.com/group/algogeeks?hl=en.
>>>
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to [email protected].
>> To unsubscribe from this group, send email to
>> [email protected].
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>
>
> --
> *Regards,*
> *Piyush Kapoor,*
> *CSE-IT-BHU*
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to