Float vars doubt

This is a discussion on Float vars doubt within the C++ Programming forums, part of the General Programming Boards category; Hello guys!!! I have a doubt: If I create a float variable: //first command float n = 2.59f; //second command ...

  1. #1
    Registered User
    Join Date
    Aug 2004
    Posts
    3

    Question Float vars doubt

    Hello guys!!! I have a doubt:

    If I create a float variable:

    //first command
    float n = 2.59f;

    //second command
    float n = 2.59;

    In one command, there is the letter "f" next the number... but the two commands work equal. What the difference between they?

    Thank you!

    Silas Justiniano - Brazil.

  2. #2
    & the hat of GPL slaying Thantos's Avatar
    Join Date
    Sep 2001
    Posts
    5,681
    2.59 by default is a double by putting the f there you are saying that the literal is a float.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 2
    Last Post: 05-13-2009, 03:25 PM
  2. Replies: 14
    Last Post: 06-28-2006, 01:58 AM
  3. Could somebody please help me with this C program
    By brett73 in forum C Programming
    Replies: 6
    Last Post: 11-25-2004, 01:19 AM
  4. Half-life SDK, where are the constants?
    By bennyandthejets in forum Game Programming
    Replies: 29
    Last Post: 08-25-2003, 11:58 AM
  5. How do you search & sort an array?
    By sketchit in forum C Programming
    Replies: 30
    Last Post: 11-03-2001, 04:26 PM

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