On Sun, Apr 11, 2010 at 6:55 PM, GentLeBoY <[email protected]> wrote:

> how to store fractional numbers with a fractional part having 25-30
> digits after decimal place,
> does long double has the same precision as double?.
> 1 more prob.
> format specifier for long double is %lf and same for double, so if i
> write
>       long double a;
>       scanf("%lf",&a);
>       a=a*2;
>       printf("%lf",a);
> why is the output -2.0000  ?
>
> --
> 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]<algogeeks%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>
>

Float has single precision.
double has double precision.
Long double has extended precision.

For your requirement, even a float would suffice. check out the value of
FLT_MAX . It is of the order of 10^37.

~Himanshu Aggarwal

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