delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/11/15/11:50:46

From: "J.W. Dare" <jwdare AT novia DOT net>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: DBL_EPSILON
Date: 15 Nov 2001 10:36:05 -0600
Lines: 31
Message-ID: <lsq7vts49kmni80sbraq83ju4dq9rea2ta@4ax.com>
References: <imk6vtk0jre49lhjone32d9ekiqg9i3a97 AT 4ax DOT com> <3BF1FDC4 DOT 93E42C1B AT earthlink DOT net>
NNTP-Posting-Host: 216.40.2.76
X-Trace: 1005841995 newscene.com 216.40.2.76 216.40.2.76
Filter-NNTP-Posting-Host: 216.40.2.76
Filter-X-Trace: 1005841995 newscene.com 52233 216.40.2.76
X-Newsreader: Forte Agent 1.8/32.548
MIME-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

On Thu, 15 Nov 2001 06:43:08 GMT, Martin Ambuhl
<mambuhl AT earthlink DOT net> wrote:

>"J.W. Dare" wrote:
>> 
>> Can someone tell me the value of DBL_EPSILON defined in float.h.
>
>You can:
>
>#include <float.h>
>#include <stdio.h>
>
>int main(void)
>{
>   printf("DBL_EPSILON is %.*g\n", DBL_DIG, DBL_EPSILON);
>   return 0;
>}

Thank you.  

I'm writing in C++ and I wasn't sure of what value to pass to
setprecision()in order to obtain a reliable answer.  May I conclude
then that DBL_DIG is the number of significant digits of accuracy for
a type double?  

As an aside, I'm not yet familiar with precision issues concerning
floating point numbers.  Can someone point me in the direction of a
good book or web page that discusses this information? 
-- 
J.W.Dare
jwdare AT novia DOT net

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019