printf precision

This is a discussion on printf precision within the C Programming forums, part of the General Programming Boards category; Does anyone know what is the max number of digits that can be displayed after a decimal point using printf ...

  1. #1
    Unregistered
    Guest

    printf precision

    Does anyone know what is the max number of digits that can be displayed after a decimal point using printf with a double variable?

    Thanks

  2. #2
    Registered User
    Join Date
    Jan 2002
    Location
    Vancouver
    Posts
    2,220
    It's either 8, 16, 6 or 12 [or it could be different]

    I don't know

  3. #3
    Registered User
    Join Date
    Jan 2002
    Location
    Vancouver
    Posts
    2,220
    why dont you try it?

    Code:
    double d = 1.93221839218398219281928918192182198219218219821218219821
    printf("%f",d);

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. IF CONDITION plese help
    By birumut in forum C Programming
    Replies: 12
    Last Post: 03-06-2009, 08:48 PM
  2. making it portable.....?
    By ShadeS_07 in forum C Programming
    Replies: 11
    Last Post: 12-24-2008, 08:38 AM
  3. get keyboard and mouse events
    By ratte in forum Linux Programming
    Replies: 10
    Last Post: 11-17-2007, 04:42 PM
  4. Simple C question: user input to repeat a loop
    By evernaut in forum C Programming
    Replies: 2
    Last Post: 11-18-2006, 08:23 AM
  5. Drawing tables in C
    By stanoman in forum C Programming
    Replies: 5
    Last Post: 10-09-2003, 10:14 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21