This is the mail archive of the gsl-discuss@sources.redhat.com mailing list for the GSL project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: problems with long double data type...


On Tue, Nov 12, 2002 at 11:02:29AM -0600, Atakan Gurkan wrote:
> Hi,
> I don't know if stdio.h in RH7.3 is suitable for printing long double but
> installing GSL from scratch would require you to run configure script that
> checks this. In the meanwhile, assuming you need precision rather than large
> exponents, you might try something like this:
> 
> #include <stdio.h>
> 
> int main(){
> 	long double pi;
> 	pi = 3.14159265358979323; /* this is outside double precision limit */
ooops I made a mistake. This should read:
pi = 3.14159265358979323L;
otherwise compiler will truncate it during compilation :(. It doesn't change the
idea i was trying to illustrate but, what I have written was not what I meant.
> 	printf("%24.18f\n", (double) pi);
> 	return 0;

ato


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]