Thread: Pow {2.,} ???

  1. #1
    Registered User
    Join Date
    Feb 2002

    Pow {2.,} ???

    What does this function ? The ., is messing me up! I have never seen this syntax before.

  2. #2
    Just Lurking Dave_Sinkula's Avatar
    Join Date
    Oct 2002
    A 2. is a double with the value of 2, whereas 2 is an int with a value of 2.

    But providing full context would make this less of a guess as to what you are asking.
    7. It is easier to write an incorrect program than understand a correct one.
    40. There are two ways to write error-free programs; only the third one works.*

  3. #3
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    What does this function ?
    I don't think it's a function. It looks more like an initializer list.

    Maybe it looks something like this:
    double Pow[size] = {2.,};
    If so, it initializes the first element in Pow to 2.0, and the others to 0.0.

    BTW, you can use 2.0 or (double)2 if it's more readable for you.

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell

    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ:

    My website:
    Projects: codeform, xuni, atlantis, nort, etc.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. What's the difference between pow() vs shift?
    By Overworked_PhD in forum C Programming
    Replies: 9
    Last Post: 01-06-2008, 01:04 PM
  2. Help with pow()
    By jedi_jinn in forum C Programming
    Replies: 7
    Last Post: 10-09-2006, 02:17 AM
  3. trying to use pow()
    By Mikecore in forum C Programming
    Replies: 9
    Last Post: 10-09-2005, 06:30 PM
  4. pow function returns wrong value
    By ckbales in forum C Programming
    Replies: 5
    Last Post: 02-01-2003, 09:46 PM
  5. Problem with pow()
    By RMacFly in forum C Programming
    Replies: 4
    Last Post: 09-18-2001, 11:54 AM