ha ha
its not like it stores slightly less than actual  :P :P

try this

float a=0.5,b=1.0,c=0.7;

if(0.5==a)
printf("yes a=0.5\n");

if(1.0==b)
printf("yes b=1.0\n");

if(0.7!=c)
printf("Yes c!=0.7\n");

o/p will be
yes a=0.5
yes b=1.0
yes c!=0.7

check it out i will explain it later...
On Fri, Aug 5, 2011 at 9:26 PM, Rajesh Kumar <[email protected]>wrote:

> Thanks to all
>
>
> On Fri, Aug 5, 2011 at 8:53 PM, sukran dhawan <[email protected]>wrote:
>
>> coz by default all real values are converted to double and it is larger
>> than float.ie real nos are not stored accurately inside computer
>> memory.so
>> since double occupies more memory it prints hi
>>
>>
>> On Fri, Aug 5, 2011 at 8:24 PM, Kamakshii Aggarwal <[email protected]
>> > wrote:
>>
>>> the reason is dat 0.7 is treated as double..therefore double(0.7)
>>> >float(0.7)
>>>
>>> On Fri, Aug 5, 2011 at 8:20 PM, kartik sachan 
>>> <[email protected]>wrote:
>>>
>>>> the output will be hi
>>>>
>>>> even if u have putted equal to sign there this is becoz 0.7 do not
>>>> exactly stored like 0.7 in a but some thing lesser as describe in ASCII
>>>> format
>>>> that's why it is awlays lesser than 0.7
>>>>
>>>>  --
>>>> 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,
>>> Kamakshi
>>> [email protected]
>>>
>>>  --
>>> 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
> Rajesh Kumar
>
>
>  --
> 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
SAGAR PAREEK
COMPUTER SCIENCE AND ENGINEERING
NIT ALLAHABAD

-- 
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