help-octave
[Top][All Lists]
Advanced

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

Re: Increasing precision in octave


From: John W. Eaton
Subject: Re: Increasing precision in octave
Date: Fri, 20 Jun 2008 11:34:22 -0400

On 20-Jun-2008, Ben Abbott wrote:

| On Friday, June 20, 2008, at 10:43AM, "DimitryASuplatov" <address@hidden> 
wrote:
| >Hello,
| >I want to calculate the p-value with high precision. 
| >I mean that when I use normal_cdf function I get
| >
| >normal_cdf (real(24),m,s)
| >ans =  1
| >
| >and "1" is not enough precision for me. I want to see something like
| >0.999999999999999999999888
| >
| >How to do that?
| >
| >Thank you!
| 
| Does this work for you?
| 
|        disp (sprintf ("%26.24f", norm_cdf(real(24), m, s)))

This won't actually increase the precision.  The precision of double
precisionfloating point value has approximately 16 decimal digits.
You can print more than that, but the extra digits are not terribly
useful.  For example:

  octave:1> printf ("%.30f\n", 1/3)
  0.333333333333333314829616256247

jwe


reply via email to

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