From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11508 invoked by alias); 1 Feb 2005 21:28:53 -0000 Mailing-List: contact gsl-discuss-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gsl-discuss-owner@sources.redhat.com Received: (qmail 11473 invoked from network); 1 Feb 2005 21:28:47 -0000 Received: from unknown (HELO smtp805.mail.ukl.yahoo.com) (217.12.12.195) by sourceware.org with SMTP; 1 Feb 2005 21:28:47 -0000 Received: from unknown (HELO ?81.157.158.15?) (J.D.Lamb@btinternet.com@81.157.158.15 with plain) by smtp805.mail.ukl.yahoo.com with SMTP; 1 Feb 2005 21:28:46 -0000 Message-ID: <41FFF48E.4040903@btinternet.com> Date: Tue, 01 Feb 2005 21:28:00 -0000 From: John Lamb User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.2) Gecko/20040906 MIME-Version: 1.0 To: gsl-discuss@sources.redhat.com Subject: Re: Question References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2005-q1/txt/msg00080.txt.bz2 Przemyslaw Sliwa wrote: > All, > > I was just wondering what means > > double gsl_cdf_ugaussian_Pinv (const double P) > > Correct me if I am wrong but it seems the const word is not required > in this case and we cannot change the value of P. > I think you are right, const is not required and you don't need to worry about it when calling the function. This is certainly true in C++. Nonetheless, it is often a good idea to declare an automatic function parameter const in the function definition. This forces the compiler to check that you don't change the parameter value in the body of the function. Similarly, it is a good idea to declare any variable const if you don't intend to change it. You can declare the function as double gsl_cdf_ugaussian_Pinv (double); and define it as double gsl_cdf_ugaussian_Pinv (const double P){ ... } but it may be better to make the two match precisely either because you may want to use some editing tools that rely on a match or because you want the code to work on a compiler that can't work oout that the declaration and definition do match. -- JDL