double and precision

Discussion in 'C++' started by Knackeback, Aug 29, 2003.

  1. Knackeback

    Knackeback Guest

    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.
    Right?

    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 ?
     
    Knackeback, Aug 29, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Erik2000
    Replies:
    3
    Views:
    31,071
    Karl Heinz Buchegger
    Jun 27, 2003
  2. Sydex
    Replies:
    12
    Views:
    6,601
    Victor Bazarov
    Feb 17, 2005
  3. Dan Pop
    Replies:
    0
    Views:
    1,200
    Dan Pop
    Jun 24, 2003
  4. cyberdude
    Replies:
    2
    Views:
    5,154
    Keith Thompson
    Jun 25, 2003
  5. saneman
    Replies:
    2
    Views:
    1,537
    James Kanze
    Aug 7, 2008
Loading...

Share This Page