Results 1 to 2 of 2

Thread: How to convert int to float?

  1. #1
    Join Date
    Apr 2010
    Location
    Singapore
    Posts
    156
    Thanks
    47
    Qt products
    Qt4
    Platforms
    Windows

    Question How to convert int to float?

    How to convert int to float?
    Last edited by babygal; 21st June 2010 at 03:43.

  2. #2
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to convert int to float?

    Are you versed with data types ?
    There are some implicit conversions done by the compiler itself.

    You can simply use -
    float f = i; // i being an integer.

Similar Threads

  1. float vs double
    By Royceybaby in forum General Programming
    Replies: 4
    Last Post: 27th January 2010, 21:55
  2. float display
    By freekill in forum Newbie
    Replies: 2
    Last Post: 13th May 2009, 12:43
  3. Replies: 1
    Last Post: 10th February 2009, 09:42
  4. float value to Qspinbox
    By nErnie in forum Qt Programming
    Replies: 6
    Last Post: 17th October 2006, 08:16
  5. float
    By mickey in forum General Programming
    Replies: 5
    Last Post: 25th July 2006, 11:52

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.