Thread: Floating point in printf()

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Apr 2020
    Location
    Greater Philadelphia
    Posts
    26

    Floating point in printf()

    Maybe I'm missing something, but in the format field for printf() etc., I don't see a distinction between float variables and double variables. So how does the function know the size of the argument actually submitted? Does the compiler automatically promote float values to double where this function is concerned? Or is the programmer expected always to give it a double?
    Last edited by Alogon; 04-14-2020 at 12:06 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Cannot write multiple printf 's after a floating point
    By arfanarf in forum C Programming
    Replies: 3
    Last Post: 02-25-2014, 11:49 AM
  2. floating point number printf/string formating
    By stanlvw in forum C++ Programming
    Replies: 2
    Last Post: 04-22-2009, 04:41 PM
  3. Floating point Hex.
    By cstubbs50 in forum C Programming
    Replies: 4
    Last Post: 11-16-2005, 04:29 PM
  4. fixed point / floating point
    By confuted in forum Game Programming
    Replies: 4
    Last Post: 08-13-2002, 01:25 PM
  5. Floating point faster than fixed-point
    By VirtualAce in forum A Brief History of Cprogramming.com
    Replies: 5
    Last Post: 11-08-2001, 11:34 PM

Tags for this Thread