Mail Archives: djgpp/2001/11/15/11:50:46
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 -