[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-gsl] help needed on extended precision

From: Wilson Y. Zou
Subject: Re: [Help-gsl] help needed on extended precision
Date: Mon, 10 May 2004 16:01:13 +0200

I am just wondering if there is any flag option for gcc complier in order to
get the "extended precision".  No matter how I tried to complier my program
in Pentium 4 processor (SUSE Linux), I cannot get more than 16 digitals

It's mostly appreciated if someone who can give me some hints.


----- Original Message -----
From: "Wilson Y. Zou" <address@hidden>
To: <address@hidden>
Sent: Sunday, May 02, 2004 11:07 PM
Subject: [Help-gsl] help needed on extended precision


I am trying to figure how I could use extended precision in my program.  I
have been testing the sample program after I set export
GSL_IEEE_MODE="extended-precision".  I am just wondering in order to let
this "extended precision" work, how do I define the data type for "x",
"oldsum" and "sum", - long double??

Also, I am a little bit worrying about the fact that I am using Intel
Pentium III processor, since I read some article that to achieve the
extended precision also depends on the machine.  Is that true?

Thank you in advance if anyone who can answer the question.

best wishes,

b.t.w. I am using "gcc" to compile.

#include <stdio.h>
#include <gsl/gsl_math.h>
#include <gsl/gsl_ieee_utils.h>

main (void)
  double x = 1, oldsum = 0, sum = 0;
  int i = 0;

  gsl_ieee_env_setup (); /* read GSL_IEEE_MODE */


      oldsum = sum;
      sum += x;
      x = x / i;

      printf ("i=%2d sum=%.18f error=%g\n",
              i, sum, sum - M_E);

      if (i > 30)
  while (sum != oldsum);

  return 0;

Help-gsl mailing list

reply via email to

[Prev in Thread] Current Thread [Next in Thread]