Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > double and precision

Thread Tools

double and precision

Posts: n/a
I use data type double at 32Bit platform and from
float.h I learn:

/* Number of decimal digits of precision in a double */
#undef DBL_DIG
#define DBL_DIG 15

My questions:
Are numbers like 3, 5.45, 1.23456789012345
i.e. numbers with siginificant count of digits <= 15
precise in a mathematical sense ?

If so I can add this numbers without rounding error as
long as I do not exceed the siginificant count of digits
limit 15.

To be utterly clear:
Must I expect rounding errors if I only add numbers n
with the property "siginificant count of digits <= 15"
and the resulting sum has also this limitation ?

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
double precision and boost unittest? saneman C++ 2 08-07-2008 08:05 AM
cannot convert parameter from 'double (double)' to 'double (__cdecl *)(double)' error Sydex C++ 12 02-17-2005 06:30 PM
Float and double, precision and scale?? Erik2000 C++ 3 06-27-2003 10:29 AM
Re: long long integer and double precision number cyberdude C Programming 2 06-25-2003 07:54 PM
Re: long long integer and double precision number Dan Pop C Programming 0 06-24-2003 12:11 PM